ID EN
Math

trunc

Python 3.11

Return x with the fractional part removed, leaving the integer part. This rounds toward 0: trunc() is equivalent to floor() for positive x, and equivalent to ceil() for negative x. If x is not a float, delegates to x.__trunc__, which should return an Integral value.

Syntax

PYTHON
math.trunc(x)

See Also

floor() ceil() x.__trunc__ Integral