What is the difference between Math.Floor() and Math.Truncate() in .NET?
For example, Math.Floor(4.4) = 4 Math.Truncate(4.4) = 4.
These function behave differently for negative numbers.
Math.Truncate(-4.5) = -4
Math.Floor(-4.5) = -5
Math.Floor rounds down Math.Ceiling rounds up and Math.Truncate rounds towards zero. Thus, Math.Truncate is like Math.Floor for positive numbers, and like Math.Ceiling for negative numbers.