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:

    “Heaven nor hell shall impede my designs,” said Manfred, advancing again to seize the princess. At that instant the portrait of his grandfather ... uttered a deep sigh and heaved its breast. ... Manfred ... saw it quit its panel, and descend on the floor with a grave and melancholy air.
    Horace Walpole (1717–1797)

    Philosophical questions are not by their nature insoluble. They are, indeed, radically different from scientific questions, because they concern the implications and other interrelations of ideas, not the order of physical events; their answers are interpretations instead of factual reports, and their function is to increase not our knowledge of nature, but our understanding of what we know.
    Susanne K. Langer (1895–1985)