Function that returns the integer part of its argument.
Syntax |
i32 trunc (real value) |
---|---|
value |
Value or expression from which to get the integer part |
result |
Returns the integer part of the argument |
Validity |
Rule, Task |
Note |
Always returns a value approximating the integer less than or equal to the input value (e.g. 5.3 -> 5, 5.8 -> 5, -5.3 -> -6, ..) |
Example of use: |