Truncation and Floor Function
Truncation of positive integer numbers can be done using the floor function. Given a number to be truncated and, the number of elements to be kept behind the decimal point, the truncated value of x is
However, for negative numbers truncation does not round in the same direction as the floor function: truncation always rounds toward zero, the floor function rounds towards negative infinity.
Read more about this topic: Truncation
Famous quotes containing the words floor and/or function:
“Cats walk the floor at midnight; that enemy of fog,
The moon, wraps the bedpost in receding stillness....”
—Allen Tate (18991979)
“The press and politicians. A delicate relationship. Too close, and danger ensues. Too far apart and democracy itself cannot function without the essential exchange of information. Creative leaks, a discreet lunch, interchange in the Lobby, the art of the unattributable telephone call, late at night.”
—Howard Brenton (b. 1942)