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:

    “Cats walk the floor at midnight; that enemy of fog,
    The moon, wraps the bedpost in receding stillness....”
    —Allen Tate (1899–1979)

    “My function in life is not to be a politician in Parliament: it is to get something done.”
    —Bernadette Devlin (b. 1947)