trunc (Function)

Signature: trunc(x: t0) -> t0

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

Parameters

  • x (t0): The float to truncate

Returns: t0

Example

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