(mathematics) Dropping or neglecting decimals after some significant place. Also known as truncation.
| Sci-Tech Dictionary: rounding |
(mathematics) Dropping or neglecting decimals after some significant place. Also known as truncation.
| 5min Related Video: Rounding |
| Computer Desktop Encyclopedia: round |
To eliminate rightmost digits in a number when absolute precision is not required or used. One of the most common uses of rounding is with dollar amounts, which can result in more than two decimal places after a division. Following are four of many rounding methods:
Round Half Up 3.455 -> 3.46
3.454 -> 3.45
Round Half Down 3.455 -> 3.45
3.456 -> 3.46
Round Up 3.456 -> 3.46
3.453 -> 3.46
Round Down 3.458 -> 3.45
3.453 -> 3.45
Download Computer Desktop Encyclopedia to your iPhone/iTouch
| Banking Dictionary: Rounding |
1. Banking. In consumer credit, the allowed tolerance in computing the Annual Percentage Rate (APR) finance charge disclosed in loan agreements. Federal Reserve Regulation Z allows rate variations as much as 1⁄8 of 1% above, or below, the exact interest rate. For example, an annual percentage rate of 10.3333 may be stated as 10.33%, 10.3%, or 10.25%.
2. Finance. The practice of shortening publicly disclosed information by adjusting a figure upward or downward to the nearest whole number. The practice simplifies disclosure in annual reports, for example, when zeroes are omitted, and conveys to the casual observer the same information as the fully expressed data.
| WordNet: rounding |
The noun has one meaning:
Meaning #1:
(mathematics) a miscalculation that results from rounding off numbers to a convenient number of decimals
Synonym: rounding error
| Wikipedia: Rounding |
Rounding a numerical value means replacing it by another value that is approximately equal but has a shorter, simpler, or more explicit representation; for example, replacing US$ 23.4476 by US$ 23.45, or the fraction 312/937 by 1/3, or
by 1.41.
Rounding produces a value that is easier to write and handle than the original, but, on the other hand, it also introduces some round-off error in the result. Rounding is almost unavoidable in many computations — especially when dividing two numbers in integer or fixed point arithmetic; when computing mathematical functions such as square roots, logarithms, and sines; or when using a floating point representation with a fixed number of significant digits.
Accurate rounding of mathematical functions is difficult because the number of extra digits that need to be calculated to resolve whether to round up or down is not known in advance. This problem is known as the table-maker's dilemma.
Rounding has many similarities to the quantization that occurs when physical quantities must be encoded by numbers or digital signals.
Contents |
Typical rounding problems are
The most basic form of rounding is to replace an arbitrary number by an integer. This operation underlies many other kinds of rounding, such as rounding to whole hundredths, to thousands, to whole dozens, etc.. In general, rounding a number x to a multiple of some specified number m entails the following steps:
For example, rounding x = 2.1785 dollars to whole hundredths (i.e., to a multiple of 0.01) entails computing y = x/m = 2.1785/0.01 = 217.85, then rounding y to the integer q = 218, and finally computing z = q×m = 218×0.01 = 2.18.
Rounding can be done in any number system; in computers, it is usually performed on binary numbers.
There are many ways of rounding a number y to an integer q. The most common ones are
The last four methods are called directed rounding, as the displacements from the original number y to the rounded value q are all directed towards or away the same limiting value (0, +∞, or -∞).
If y is positive, round-down is the same as round-towards-zero, and round-up is the same as round-away-from-zero. If y is negative, round-down is the same as round-away-from-zero, and round-up is the same as round-towards-zero. In any case, if y is integer, q is just y. The following table illustrates these rounding methods:
| y | to nearest |
towards zero |
down | up | away from zero |
| +23.67 | +24 | +23 | +23 | +24 | +24 |
| +23.35 | +23 | +23 | +23 | +24 | +24 |
| −23.35 | −23 | −23 | −24 | −23 | −24 |
| −23.67 | −24 | −23 | −24 | −23 | −24 |
Rounding a number y to the nearest integer requires some tie-breaking rule for those cases when y is exactly half-way between two integers — that is, when the fraction part of y is exactly .5
Where many calculations are done in sequence rounding can have a very significant effect on the result. A famous instance involved a new index set up by the Vancouver Stock Exchange in 1982. It was initially set at 1000.000 but after 22 months had fallen to about 520 whereas the market was doing well. The problem was caused by the index being held to 3 decimal places, always rounded down. The index was recalculated thousands of times daily and the errors accumulated. Recalculating with better rounding gave a value of 1098.892.[1]
The following tie-breaking rule, called round half up, is widely used in many disciplines:
That is, half-way values y are always rounded up. For example, by this rule the value 23.5 gets rounded to 24, but -23.5 gets rounded to -23.
This is one of two rules generally taught in US elementary mathematics classes.[citation needed]
If it were not for the 0.5 fractions, the roundoff errors introduced by the round to nearest method would be quite symmetric: for every fraction that gets rounded up (such as .732), there is a complementary fraction (namely, .268) that gets rounded down, by the same amount. When rounding a large set of numbers with random fractional parts, these rounding errors would statistically compensate each other, and the expected (average) value of the rounded numbers would be equal to the expected value of the original numbers.
However, the "round half up" tie-breaking rule is not symmetric, as the fractions that are exactly 0.5 always get rounded up. This asymmetry introduces a positive bias in the roundoff errors. For example, if the fraction of y consists of three random decimal digits, then the expected value of q will be 0.0005 higher than the expected value of y. For this reason, round-to-nearest with the round-half-up rule is also known as asymmetric rounding.
The other tie-breaking method commonly taught and used is the round half away from zero, namely:
For example, 23.5 gets rounded to 24, and -23.5 gets rounded to -24.
This method treats positive and negative values symmetrically, and therefore is free of overall bias if the original numbers are positive or negative with equal probability. However, this rule will still introduce a positive bias for positive numbers, and a negative bias for the negative ones.
A tie-breaking rule that is even less biased is round half to even, namely
Thus, for example, +23.5 becomes +24, +22.5 becomes +22, -22.5 becomes -22, and -23.5 becomes -24. This variant of the round-to-nearest method is also called unbiased rounding, convergent rounding, statistician's rounding, Dutch rounding, Gaussian rounding, or bankers' rounding. For most reasonable distributions of y values, the expected (average) value of the rounded numbers is essentially the same as that of the original numbers, even if the latter are all positive (or all negative). This is widely used in bookkeeping.
Another unbiased tie-breaking method is stochastic rounding:
Like round-half-to-even, this rule is essentially free of overall bias; but it is also fair among even and odd q values. On the other hand, it introduces a random component into the result: performing the same computation twice on the same data may yield two different results.
In some contexts, all the rounding methods above may be unsatisfactory. For example, suppose that y is an accurate measurement of an audio signal, which is being rounded to an integer q in order to reduce the storage or transmission costs. If y changes slowly with time, any of the rounding method above will result in q being completely constant for long intervals, separated by sudden jumps of ±1. When the q signal is played back, these steps will be heard as a very disagreeable noise, and any variations of the original signal between two integer values will be completely lost.
One way to avoid this problem is to round each value y upwards with probability equal to its fraction, and round it downwards with the complement of that probability. For example, the number 23.17 would be rounded up to 24 with probability 0.17, and down to 23 with probability 1-0.17 = 0.83. (This is equivalent to rounding y+s to the nearest integer, where s is a random number uniformly distributed between 0 and 1.) With this special rounding, known as dithering, the sudden steps get replaced by a less objectionable noise, and even small variations in the original signal will be preserved to some extent.
In floating-point arithmetic, rounding aims to turn a given value x into a value z with a specified number of significant digits. In other words, z should be a multiple of a number m that depends on the magnitude of z. The number m is a power of the base (usually 2 or 10) of the floating-point representation.
Apart from this detail, all the variants of rounding discussed above apply to the rounding of floating-point numbers as well.
For results where the rounded result would overflow the result for a directed rounding is either the appropriate infinity or the highest representable finite number depending on the direction. The result of an overflow for the usual case of round to even is always the appropriate infinity.
In some contexts it is desirable to round a given number x to a "neat" fraction — that is, the nearest fraction z = m/n whose numerator m and denominator n do not exceed a given maximum. This problem is fairly distinct from that of rounding a value to a fixed number of decimal or binary digits, or to a multiple of a given unit m. This problem is related to Farey sequences, the Stern-Brocot tree, and continued fractions.
It is possible to use rounded arithmetic to evaluate the exact value of a function with a discrete domain and range. For example, if we know that an integer n is a perfect square, we can compute its square root by converting n to a floating-point value x, computing the approximate square root y of x with floating point, and then rounding y to the nearest integer q. If n is not too big, the floating-point roundoff error in y will be less than 0.5, so the rounded value q will be the exact square root of n. In most modern computers, this method may be much faster than computing the square root of n by an all-integer algorithm.
William Kahan coined the term "The Table-Maker's Dilemma" for the unknown cost of rounding transcendental functions:
"Nobody knows how much it would cost to compute y^w correctly rounded for every two floating-point arguments at which it does not over/underflow. Instead, reputable math libraries compute elementary transcendental functions mostly within slightly more than half an ulp and almost always well within one ulp. Why can't Y^W be rounded within half an ulp like SQRT? Because nobody knows how much computation it would cost... No general way exists to predict how many extra digits will have to be carried to compute a transcendental expression and round it correctly to some preassigned number of digits. Even the fact (if true) that a finite number of extra digits will ultimately suffice may be a deep theorem."[2]
The IEEE floating point standard guarantees that add, subtract, multiply, divide, square root, and floating point remainder will give the correctly rounded result of the infinite precision operation. However, no such guarantee is given for more complex functions and they are typically only accurate to within the last bit at best.
Using the Gelfond–Schneider theorem and Lindemann–Weierstrass theorem many of the standard elementary functions can be proved to return transcendental results when given rational non-zero arguments; therefore it is always possible to correctly round such functions. However there is no way of determining in advance how accurate a result needs to be computed before a correctly rounded result can be produced.
There are some packages around now that offer full accuracy. The MPFR package gives correctly rounded arbitrary precision results. IBM have written a package for fast and accurate IEEE elementary functions and in the future the standard libraries may offer such precision.[3]
It is possible to devise well defined computable numbers which it may never be possible to correctly round no matter how many digits are calculated. For instance if Goldbach's conjecture is true but unprovable then it is impossible to correctly round down 0.5 + 10-n where n is the first even number greater than 4 which is not the sum of two primes, or 0.5 if there is no such number. This can however be approximated to any given precision even if the conjecture is unprovable.
The concept of rounding is very old, perhaps older even than the concept of division. Some ancient clay tablets found in Mesopotamia contain tables with rounded values of reciprocals and square roots in base 60.[citation needed].
The Round-to-even method has served as the ASTM (E-29) standard since 1940. The origin of the terms unbiased rounding and statistician's rounding are fairly self-explanatory. In the 1906 4th edition of Probability and Theory of Errors [1] Robert Simpson Woodward called this "the computer's rule" indicating that it was then in common use by human computers who calculated mathematical tables. Churchill Eisenhart's 1947 paper "Effects of Rounding or Grouping Data" (in Selected Techniques of Statistical Analysis, McGrawHill, 1947, Eisenhart, Hastay, and Wallis, editors) indicated that the practice was already "well established" in data analysis.
The origin of the term bankers' rounding remains more obscure. If this rounding method was ever a standard in banking, the evidence has proved extremely difficult to find. To the contrary, section 2 of the European Commission report The Introduction of the Euro and the Rounding of Currency Amounts [2] suggests that there had previously been no standard approach to rounding in banking; and it specifies that "half-way" amounts should be rounded up.
Until the 1980s, the rounding method used in floating-point computer arithmetic was usually fixed by the hardware, poorly documented, inconsistent, and different for each brand and model of computer. This situation changed after the IEEE 754 floating point standard was adopted by most computer manufacturers. The standard allows the user to choose among several rounding modes, and in each case specifies precisely how the results should be rounded. These features made numerical computations more predictable and machine-independent, and made possible the efficient and consistent implementation of interval arithmetic.
<math.h>):
round(): round to nearest integer, halfway away from zerorint(), nearbyint(): round according to current floating-point rounding directionceil(): smallest integral value not less than argument (round up)floor(): largest integral value not greater than argument (round down)trunc(), (int)[4]: round towards zerofegetround()/fesetround() functions defined in <fenv.h>; the available directions are specified to be at least those in IEEE 854 (see IEEE 754#Rounding floating-point numbers) which include round-to-even, round-down, round-up, and round-to-zero.NINT: round to nearest integer, return integer resultANINT: round to nearest integer, return real resultINT: truncate (round towards zero), return integer resultAINT: truncate (round towards zero), return real resultCEILING: smallest integral value not less than argument (round up) (Fortran-90)FLOOR: largest integral value not greater than argument (round down) (Fortran-90)Math and StrictMath: round-half-up (asymmetric) or round-to-even (Math.rint).[5][6]BigDecimal: Supports "round up", "round down", "round floor", "round ceiling", "round half up", "round half down", "round half even" and even a "rounding unnecessary" mode. Note, however, that the implementation of round half-up is symmetric, unlike the implementation of round half-up in Java.Math.Math.round(-3.5) or StrictMath.round(-3.5) gives −3.Math.ceil: round upMath.floor: round downMath.round: round to nearest (halves up)round: round-to-even, fractional part as secondary value:
(round 2.5) ; => 2, 0.5(round 3.5) ; => 4, -0.5truncate, floor, ceiling: round to zero, down or up respectively, fractional part as secondary value:
(floor -2.5) ; => -3, 0.5(ceiling -2.5) ; => -2, -0.5Round: round to even
Round[2.5] gives 2Round[3.5] gives 4IntegerPart: round toward zero
IntegerPart[2.7] gives 2IntegerPart[-2.7] gives -2Floor: round down
Floor[2.7] gives 2Floor[-2.3] gives -3Ceiling: round up
Ceiling[2.3] gives 3Ceiling[-2.7] gives -2round(X): round to nearest integer, trailing 5 rounds to the nearest integer away from zero
round(2.5) returns 3round(-2.5) returns -3fix(X): round to nearest integer toward zero (truncate)
fix(2.7) returns 2fix(-2.7) returns -2floor(X): round to the nearest integer toward minus infinity (round to the nearest integer less than or equal to X)
floor(2.7) returns 2floor(-2.3) returns -3ceil(X): round to the nearest integer toward positive infinity (round to the nearest integer greater than or equal to X)
ceil(2.3) returns 3ceil(-2.7) returns -2Round and RoundTo (nonstandard) use bankers' roundingStr (nonstandard), Write and FloatToStr (nonstandard) don't use bankers' roundingCeil(): smallest integral value not less than argument (round up)Floor(): largest integral value not greater than argument (round down)Trunc(): round towards zeroprintf "%f" or sprintf "%f": use bankers' roundingint: chops off fractional part, rounding towards zeroPOSIX::ceil: smallest integral value not less than argument (round up)POSIX::floor: largest integral value not greater than argument (round down)round(-3.5) gives −4.round(8.7352, 3) gives 8.735.round(4278.5, -2) gives 4300.round(0.5) is 1.0, round(-0.5) is -1.0.round(1.5) is 2.0, round(2.5) is 2.0.2.5.round gives 3.3.5.round gives 4.-3.5.round gives −4.? Round(2.5, 0) gives 2.= ROUND(2.5, 0) gives 3.= ROUND(3.5, 0) gives 4.= ROUND(-3.5, 0) gives −4CType(value, Integer) uses bankers' rounding. Since this is a .NET language, programs may also use any of the rounding methods of the .NET framework (see above).round is the rounding function. By default, it rounds to the nearest even number. However, it takes an optional tag that specifies how to round: rounding up, rounding down, rounding toward zero, or rounding as taught in school (round-half-up). rounding to nearest is a synonym for the default behavior.Some disciplines or institutions have issued standards or directives for rounding.
In a guideline issued in mid-1966,[11] the U.S. Office of the Federal Coordinator for Meteorology determined that weather data should be rounded to the nearest round number, with the "round half up" tie-breaking rule. For example, 1.5 rounded to integer should become 2, and −1.5 should become −1. Prior to that date, the tie-breaking rule was "round half away from zero".
Some meteorologists may write "−0" to indicate a temperature between 0.0 and −0.5 degrees (exclusive) that was rounded to integer. This notation is used when the negative sign is considered important, no matter how small is the magnitude; for example, when rounding temperatures in the Celsius scale, where below zero indicates freezing.[citation needed]
java.lang.Math Java 2 Platform SE 5.0. Sun Microsystems (2005-07-22). Retrieved on 2008-11-08.java.lang.StrictMath Java 2 Platform SE 5.0. Sun Microsystems (2007-01-03). Retrieved on 2008-11-08.| This article needs additional citations for verification. Please help improve this article by adding reliable references. Unsourced material may be challenged and removed. (November 2008) |
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)
| capping plane | |
| gingival festoon | |
| blunting (design engineering) |
| You are small and round and can be rolled you keep things in and move round and round What are you? Read answer... | |
| Why are igloos round? Read answer... | |
| How do you knit in the round? Read answer... |
| You are round what are you? | |
| What is rounds? | |
| What is your round? |
Copyrights:
![]() | Sci-Tech Dictionary. McGraw-Hill Dictionary of Scientific and Technical Terms. Copyright © 2003, 1994, 1989, 1984, 1978, 1976, 1974 by McGraw-Hill Companies, Inc. All rights reserved. Read more | |
![]() | Computer Desktop Encyclopedia. THIS COPYRIGHTED DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher. © 1981-2009 Computer Language Company Inc. All rights reserved. Read more | |
![]() | Banking Dictionary. Dictionary of Banking Terms. Copyright © 2006 by Barron's Educational Series, Inc. All rights reserved. Read more | |
![]() | WordNet. WordNet 1.7.1 Copyright © 2001 by Princeton University. All rights reserved. Read more | |
![]() | Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Rounding". Read more |
Mentioned in