suve

awful: function: trunc

Declaration

int :trunc ( float $NUMBER )

Summary

Truncates a real number (returns the integer part).

Example

# :trunc example
:writeln :trunc f+3.3   # Should be +3
:writeln :trunc f+3.9   # Should be +3
:writeln :trunc f-4.1   # Should be -4
:writeln :trunc f-4.8   # Should be -4

wikipage modified on 2014/0601/2317