proc/trunc(x)
return x && x / abs(x) * round(abs(x))
I wrote this because I saw somewhere on the forums that someone recommended round()(whose default format is floor()) to truncate a number. That's incorrect. The reasoning for this is simple: truncating rounds towards zero and round() rounds towards negative infinity.
round(-3.14159) // -4
trunc(-3.14159) // -3
// The only exception!
round(3.14159) // 3
trunc(3.14159) // 3
round(-3.14159,1) // -3