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:
“Because humans are not alone in exhibiting such behaviorbees stockpile royal jelly, birds feather their nests, mice shred paperits possible that a pregnant woman who scrubs her house from floor to ceiling [just before her baby is born] is responding to a biological imperative . . . . Of course there are those who believe that . . . the burst of energy that propels a pregnant woman to clean her house is a perfectly natural response to their mothers impending visit.”
—Mary Arrigo (20th century)
“... The states one function is to give.
The bud must bloom till blowsy blown
Its petals loosen and are strown;
And thats a fate it cant evade
Unless twould rather wilt than fade.”
—Robert Frost (18741963)