Truncation
≈ 1 min read
Names in other languages
- DeutschTrunkierung
- EnglishTruncation
- NederlandsTruncation
- Românătrunchiere
- eoTranĉo
- 한국어트렁케이션
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
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. \operatorname{trunc}(x,n) = \frac{\lfloor 10^n \cdot x \rfloor}{10^n}. However, for negative numbers truncation does not round in the same direction as the floor function: truncation always rounds toward zero, the \operatorname{floor} function rounds towards negative infinity. For a given number x \in \mathbb{R}_- , the function \operatorname{ceil} is used instead \operatorname{trunc}(x,n) = \frac{\lceil 10^n \cdot x \rceil}{10^n} .
Text derived from https://en.wikipedia.org/w/index.php?oldid=1339355331 under CC BY-SA 4.0; modifications have been made.