HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
and
computer science Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, truncation is limiting the number of digits right of the
decimal point FIle:Decimal separators.svg, alt=Four types of separating decimals: a) 1,234.56. b) 1.234,56. c) 1'234,56. d) ١٬٢٣٤٫٥٦., Both a comma and a full stop (or period) are generally accepted decimal separators for international use. The apost ...
.


Truncation and floor function

Truncation of positive real numbers can be done using the
floor function In mathematics, 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 integer greater than or eq ...
. 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 \operatorname function rounds towards negative infinity. For a given number x \in \mathbb_-, the function \operatorname is used instead :\operatorname(x,n) = \frac.


Causes of truncation

With computers, truncation can occur when a decimal number is typecast as an
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
; 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 measurement, measure a continuous variable, continuous one-dimensional quantity such as a time, duration or temperature. Here, ''continuous'' means that pairs of values can have arbi ...
.


In algebra

An analogue of truncation can be applied to
polynomial In mathematics, a polynomial is a Expression (mathematics), mathematical expression consisting of indeterminate (variable), indeterminates (also called variable (mathematics), variables) and coefficients, that involves only the operations of addit ...
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 *
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 tr ...
* Precision (computer science) * Truncation (statistics)


References

{{Reflist


External links


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