Truncation
From Coderwiki
More actions
Truncation is a form of rounding where the result is always floored. This essentially means that the non-integer (decimal) part of a float is 'chopped off' (truncated).
Examples
edit edit sourceBelow some floating point numbers are shown, as well as the integers they round to when truncated:
1.2 -> 1 7.9 -> 7 8.0 -> 8 9.9 -> 9 -3.4 -> -3 -7.8 -> -7