Truncation (math)

from Wikipedia, the free encyclopedia

In mathematics and computer science, truncation describes an arithmetic operation in which a sequence or a decimal number is shortened to a certain length. For decimal numbers this means that decimal places are deleted.

Difference to the rounding function

The following applies to a number that is to be truncated to decimal places

.

For negative real numbers , however, the following applies

,

where and stand for the rounding function and the rounding function .

For positive numbers, the truncation with therefore corresponds to the rounding function. In the case of negative numbers, however, the rounding function is equivalent in this case.

Typecast

Truncation with occurs in C / C ++ when converting a floating point number to an integer .

Polynomials

Analogous to truncation with decimal numbers, the truncation of a polynomial can be defined. That is the sum of the polynomial terms up to the degree .

example

Be . The different truncations are then

, , .

Individual evidence

  1. Ronald B. Guenther, Abdelwahab Kharab: An Introduction to Numerical Methods: a MATLAB approach . 4th edition. CRC Press, Boca Raton 2019, ISBN 978-1-138-09307-2 , pp. 32 .
  2. Type conversions. In: cplusplus.com. Retrieved July 5, 2019 .
  3. Michael Spivak: Calculus . 4th edition. Publish or Perish, Houston 2008, ISBN 978-0-914098-91-1 , pp. 434 .