Truncation - Truncation and Floor Function

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:

    They seldom looked happy. They passed one another without a word in the elevator, like silent shades in hell, hell-bent on their next look from a handsome stranger. Their next rush from a popper. The next song that turned their bones to jelly and left them all on the dance floor with heads back, eyes nearly closed, in the ecstasy of saints receiving the stigmata.
    Andrew Holleran (b. 1943)

    To look backward for a while is to refresh the eye, to restore it, and to render it the more fit for its prime function of looking forward.
    Margaret Fairless Barber (1869–1901)