trunc (Function)

Signature: trunc(x: float) -> float

Description: The integer part of x toward zero, as a float. Total.

Parameters

  • x (float): The float to truncate

Returns: float

Example

print(trunc(-2.7))  // -2.0
print (trunc -2.7)  // -2.0