In mathematics and computer science, truncation is limiting the number of digits right of the decimal point. In mathematics and computer science, truncation is limiting the number of digits right of the decimal point. Truncation of positive real numbers can be done using the floor function. Given a number x ∈ R + {displaystyle xin mathbb {R} _{+}} to be truncated and n ∈ N 0 {displaystyle nin mathbb {N} _{0}} , 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. For a given number x ∈ R − {displaystyle xin mathbb {R} _{-}} , the function