|
|
|
|
|
Rounding is a general technique for approximating a real number by a decimal fraction. There are several ways of rounding a real number, five of which are the most common: rounding up, rounding down, truncation, ordinary rounding (or rounding for short), and banker's rounding.
The simplest kind of rounding is that of rounding a real number to an integer. Let be a real number. Then
- rounding up:
- rounding up of
is taking the smallest integer that is greater than or equal to . This integer is denoted by the ceiling function
Examples:
, and
.
- rounding down:
- rounding down of
is taking the largest integer that is less than or equal to . This integer is denoted by the floor function
Examples:
, and
.
- truncation:
- rounding by truncation is done by ignoring all decimals to the right of the decimal point, which is equivalent to taking only the integer part of
. The truncation of is denoted by . In terms of
rounding up and rounding down: we have
If we write as a decimal number using decimal expansion, then is the integral portion of .
Examples: , and
.
- ordinary rounding:
- this is the most commonly used of the rounding methods described so far. (Ordinary) rounding of
is finding the closest integer to , and if is exactly half way between two integers, use the larger of the two as the result. Let represents the ordinary rounding of . It is easy to see that
Examples:
, while .
There is an easy algorithm of rounding to the nearest integer.
- write
as a decimal number using decimal expansion
- if the tenths decimal place value is less than
, then ![$ R(r)=[r]$ $ R(r)=[r]$](http://images.planetmath.org:8080/cache/objects/9840/l2h/img32.png)
- if the tenths decimal place value is at least
, then
.
- banker's rounding:
- a variant of the ordinary rounding is the banker's rounding: if
is exactly half way between two integers, and the integer portion of is even, round down . Otherwise, use ordinary rounding on . If denotes the banker's rounding of , then it can be defined as
For example, , while .
- stochastic rounding:
- this rounding method requires the aid of a random number generator. Rounding of
may be done using any of the above methods when is not exactly half way between two consecutive integers. Otherwise, is randomly rounded up or down based on the outcome of randomly selecting a number between 0 and 1 using a random number generator. The choice of rounding up (and thus down) depends on how numbers are in are allocated for rounding up (or down).
- alternate rounding:
- this rounding method, like the last one, uses other available methods except when the number in question
is exactly half way between two consecutive integers. However, this method is used in a situation where a sequence of numbers needs to be rounded:
- the first number in the sequence is rounded using any of the above methods;
- when the
-th number is rounded, the -th number is rounded as follows: if the number is exactly half way between two consecutive integers, then it is rounded down if the -th number is rounded up, and vice versa. Otherwise, use the rounding method used to round the first number in the sequence.
More generally, the three methods described can be applied to rounding of to a decimal fraction. The general procedure is as follows:
- First, specify how accurately we want to round
. This can be accomplished by specifying to what decimal place we want to approximate . Let this place be (note that if it is to the right of the decimal point and otherwise).
- Write
as a decimal number using decimal expansion.
- Multiply
by . By doing this, we are basically moving the decimal point so it is positioned between the -th decimal place and the -th decimal place.
- Use any of the four methods above to round
.
- Divide the rounded number by
to get the result.
In practice, steps through can be combined into one step, simply by performing the rounding operation at the specified decimal place as if it were the ones place. For example, rounding
to the nearest thousandths place is , the thousandths place value is increased to because the ten thousandths place is .
Remark. In general, rounding to the -th decimal place can be thought of as a function from
to , the set of all decimal fractions, such that
If
denotes any of the four rounding methods described in the previous section, and corresponds to rounding to the -th decimal place using method in step above, then the entire rounding process can be summarized by a single formula:
|
"rounding" is owned by CWoo.
|
|
(view preamble)
| Other names: |
round up, round down, round to |
| Also defines: |
rounding up, rounding down, symmetric arithmetic rounding, rounding error, truncation, rounded to, banker's rounding |
|
|
Cross-references: entire, section, function, ten thousandths, thousandths, operation, divide, place, decimal place, sequence, number, outcome, consecutive, generator, random number, even, decimal place value, tenths, algorithm, easy to see, represents, integral, decimal expansion, decimal number, terms, integer part, equivalent, decimal point, right, floor function, ceiling function, integer, decimal fraction, real number
There are 6 references to this entry.
This is version 7 of rounding, born on 2007-08-08, modified 2008-06-09.
Object id is 9840, canonical name is Rounding.
Accessed 2356 times total.
Classification:
| AMS MSC: | 65G50 (Numerical analysis :: Error analysis and interval analysis :: Roundoff error) | | | 65G99 (Numerical analysis :: Error analysis and interval analysis :: Miscellaneous) | | | 65D99 (Numerical analysis :: Numerical approximation and computational geometry :: Miscellaneous) | | | 00A69 (General :: General and miscellaneous specific topics :: General applied mathematics) |
|
|
|
|
|
|
Pending Errata and Addenda
|
|
|
|
|
|
|
|
|
|
|