HOME

TheInfoList



OR:

In
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
and
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
, truncation is limiting the number of digits right of the decimal point.


Truncation and floor function

Truncation of positive real numbers can be done using the
floor function In mathematics and computer science, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least int ...
. Given a number x \in \mathbb_+ to be truncated and n \in \mathbb_0, the number of elements to be kept behind the decimal point, the truncated value of x is :\operatorname(x,n) = \frac. 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 \in \mathbb_-, the function ceil is used instead. :\operatorname(x,n) = \frac In some cases is written as . See Notation of floor and ceiling functions.


Causes of truncation

With computers, truncation can occur when a decimal number is typecast as an
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
; it is truncated to zero decimal digits because integers cannot store non-integer
real numbers In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every re ...
.


In algebra

An analogue of truncation can be applied to
polynomial In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An exampl ...
s. In this case, the truncation of a polynomial ''P'' to degree ''n'' can be defined as the sum of all terms of ''P'' of degree ''n'' or less. Polynomial truncations arise in the study of Taylor polynomials, for example.


See also

*
Arithmetic precision Significant figures (also known as the significant digits, ''precision'' or ''resolution'') of a number in positional notation are digits in the number that are reliable and necessary to indicate the quantity of something. If a number expres ...
*
Floor function In mathematics and computer science, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least int ...
*
Quantization (signal processing) Quantization, in mathematics and digital signal processing, is the process of mapping input values from a large set (often a continuous set) to output values in a (countable) smaller set, often with a finite number of elements. Rounding and ...
*
Precision (computer science) In computer science, the precision of a numerical quantity is a measure of the detail in which the quantity is expressed. This is usually measured in bits, but sometimes in decimal digits. It is related to precision in mathematics, which descri ...
* Truncation (statistics)


References

{{Reflist


External links


Wall paper applet
that visualizes errors due to finite precision Numerical analysis ja:端数処理