Truncate
   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 A decimal separator is a symbol used to separate the integer part from the fractional part of a number written in decimal form (e.g., "." in 12.45). Different countries officially designate different symbols for use as the separator. The choi ...
.


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 In film, television, and theatre, typecasting is the process by which a particular actor becomes strongly identified with a specific character, one or more particular roles, or characters having the same traits or coming from the same social or ...
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 language ...
; it is truncated to zero decimal digits because integers cannot store non-integer real numbers.


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 exa ...
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 polynomial In mathematics, the Taylor series or Taylor expansion of a function is an infinite sum of terms that are expressed in terms of the function's derivatives at a single point. For most common functions, the function and the sum of its Taylor ser ...
s, 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 expre ...
*
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 describ ...
*
Truncation (statistics) In statistics, truncation results in values that are limited above or below, resulting in a truncated sample. A random variable y is said to be truncated from below if, for some threshold value c, the exact value of y is known for all cases y > c, ...


References

{{Reflist


External links


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