FACTOID # 28: Austin, Texas has more people than Alaska.
 
 Home   Encyclopedia   Statistics   States A-Z   Flags   Maps   FAQ   About 
   
 
WHAT'S NEW
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Rounding

Rounding is the process of reducing the number of significant digits in a number. The result of rounding is a "shorter" number having fewer non-zero digits yet similar in magnitude. The result is less precise but easier to use. Significant figures (also called significant digits and abbreviated sig figs or sig digs, respectively) is a method of expressing errors in measurements. ... A round-off error, also called rounding error, is the difference between the calculated approximation of a number and its exact mathematical value. ...


Example: 73 rounded to the nearest ten is 70, because 73 is closer to 70 than to 80.


Rounding can be analyzed as a form of quantization. Quantized signal Digital signal In digital signal processing, quantization is the process of approximating a continuous range of values (or a very large set of possible discrete values) by a relatively-small set of discrete symbols or integer values. ...


There are many different rules that can be followed when rounding. Some of the more popular are described below.

Contents

Common method

This method is commonly used in mathematical applications, for example in accounting. It is the one generally taught in elementary mathematics classes. This method is also known as Symmetric Arithmetic Rounding or Round-Half-Up (Symmetric Implementation)

  • Decide which is the last digit to keep.
  • Increase it by 1 if the next digit is 5 or more (this is called rounding up)
  • Leave it the same if the next digit is 4 or less (this is called rounding down)

Examples:

  • 3.044 rounded to hundredths is 3.04 (because the next digit, 4, is less than 5).
  • 3.045 rounded to hundredths is 3.05 (because the next digit, 5, is 5 or more).
  • 3.0447 rounded to hundredths is 3.04 (because the next digit, 4, is less than 5).

For negative numbers the absolute value is rounded.


Examples:

  • −2.1349 rounded to hundredths is −2.13
  • −2.1350 rounded to hundredths is −2.14

Round-to-even method

This method is also known as unbiased rounding, convergent rounding, statistician's rounding or bankers' rounding. It is identical to the common method of rounding except when the digit(s) following the rounding digit start with a five and have no non-zero digits after it. The new algorithm is:

  • Decide which is the last digit to keep.
  • Increase it by 1 if the next digit is 6 or more, or a 5 followed by one or more non-zero digits.
  • Leave it the same if the next digit is 4 or less
  • Otherwise, all that follows the last digit is a 5 and possibly trailing zeroes; then change the last digit to the nearest even digit. That is, increase the rounded digit if it is currently odd; leave it if it is already even.

With all rounding schemes there are two possible outcomes: increasing the rounding digit by one or leaving it alone. With traditional rounding, if the number has a value less than the half-way mark between the possible outcomes, it is rounded down; if the number has a value exactly half-way or greater than half-way between the possible outcomes, it is rounded up. The round-to-even method is the same except that numbers exactly half-way between the possible outcomes are sometimes rounded up—sometimes down.


Although it is customary to round the number 4.5 up to 5, in fact 4.5 is no nearer to 5 than it is to 4 (it is 0.5 away from both). When dealing with large sets of scientific or statistical data, where trends are important, traditional rounding on average biases the data upwards slightly. Over a large set of data, or when many subsequent rounding operations are performed as in digital signal processing, the round-to-even rule tends to reduce the total rounding error, with (on average) an equal portion of numbers rounding up as rounding down. This generally reduces the upwards skewing of the result. Digital signal processing (DSP) is the study of signals in a digital representation and the processing methods of these signals. ...


Round-to-even is used rather than round-to-odd as the latter rule would prevent rounding to a result of zero.


Examples:

  • 3.016 rounded to hundredths is 3.02 (because the next digit (6) is 6 or more)
  • 3.013 rounded to hundredths is 3.01 (because the next digit (3) is 4 or less)
  • 3.015 rounded to hundredths is 3.02 (because the next digit is 5, and the hundredths digit (1) is odd)
  • 3.045 rounded to hundredths is 3.04 (because the next digit is 5, and the hundredths digit (4) is even)
  • 3.04501 rounded to hundredths is 3.05 (because the next digit is 5, but it is followed by non-zero digits)

History

The Round-to-even method has been 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 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. ASTM International is an international voluntary standards organization that develops and produces technical standards for materials, products, systems and services. ... Before mechanical and electronic computers, the term computer, in use from the mid 17th century, meant a human undertaking mathematical calculations. ... Dr. Churchill Eisenhart (died 1994) was an United States mathematician. ...


The origin of the term bankers' rounding is 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.


Other methods of rounding

Other methods of rounding exist, but use is mostly restricted to computers and calculators, statistics and science. In computers and calculators, these methods are used for one of two reasons: speed of computation or usefulness in certain computer algorithms. In statistics and science, the primary use of alternate rounding schemes is to reduce bias, rounding error and drift—these are similar to round-to-even rounding. They make a statistical or scientific calculation more accurate.


Ease of computation

Other methods of rounding include "round towards zero" (also known as truncation) and "round away from zero". These introduce more round-off error and therefore are rarely used in statistics and science; they are still used in computer algorithms because they are slightly easier and faster to compute. Two specialized methods used in mathematics and computer science are the floor (always round down to the nearest integer) and ceiling (always round up to the nearest integer). In mathematics, truncation is the term used for reducing the number of digits right of the decimal point, by discarding the least significant ones. ... A round-off error, also called rounding error, is the difference between the calculated approximation of a number and its exact mathematical value. ... The floor and fractional part functions In mathematics, the floor function of a real number x, denoted or floor(x), is the largest integer less than or equal to x (formally, ). For example, floor(2. ... In mathematics, the floor function is the function defined as follows: for a real number x, floor(x) is the largest integer less than or equal to x. ...


Statistical accuracy

Stochastic rounding is a method that rounds to the nearest integer, but when the two integers are equidistant (e.g., 3.5), then it is rounded up with probability 0.5 and down with probability 0.5. This reduces any drift, but adds randomness to the process. Thus, if you perform a calculation with stochastic rounding twice, you may not end up with the same answer. The motivation is similar to statistician's rounding. In statistics, stochastic rounding refers to a method of rounding numbers such that when rounding a fraction that falls exactly between two integers (e. ...


Round functions in programming languages

  • C
    • C99 specifies (in <math.h>):
      • round(): round to nearest integer, halfway away from zero
      • rint(), nearbyint(): round according to current floating-point rounding direction
      • ceil(): smallest integral value not less than argument
      • floor(): largest integral value not greater than argument
      • trunc(): round towards zero
    • The current floating-point rounding direction may, depending on implementation, be retrieved and set using the fegetround()/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.
  • PHP:
    • round(-3.5) gives -4.
    • round(8.7352,3) gives 8.735.
    • round(4278.5,-2) gives 4300.
  • JavaScript:
    • Uses Asymmetric Arithmetic Rounding
    • Math.round (-3.5) gives -3.
  • Visual Basic for Applications:
    • Uses Round-Half-Even (Banker's Rounding)
    • ? Round(2.5, 0) gives 2.
    • http://support.microsoft.com/kb/194983
  • Microsoft SQL Server:
    • Uses either Symmetric Arithmetic Rounding or Symmetric Round Down (Fix) depending on arguments
    • SELECT Round(2.5, 0) gives 3.
  • Microsoft Excel:
    • Uses Symmetric Arithmetic Rounding
    • = ROUND(2.5, 0) gives 3.
    • = ROUND(3.5, 0) gives 4.
    • = ROUND(-3.5, 0) gives -4
  • Microsoft .NET Framework
    • The Convert.ToInt32(Double) function and similar forms uses Banker's Rounding.
    • The Math.Round(...) overloads use Banker's Rounding by default, but .NET 2.0 added an overload that allows the developer to specify the desired type of rounding.
  • C#
    • The (int) cast rounds toward zero. Note that this is different from using the Convert class in the .NET Framework!

The Round() function is not implemented in a consistent fashion among different Microsoft products for historical reasons.
How To Implement Custom Rounding Procedures Wikibooks has a book on the topic of C Programming The C programming language (often, just C) is a general-purpose, procedural, imperative computer programming language developed in the early 1970s by Dennis Ritchie for use on the Unix operating system. ... The C Programming Language, Brian Kernighan and Dennis Ritchie, the original edition that served for many years as an informal specification of the language The C programming language is a low_level standardized programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the UNIX... math. ... The IEEE Standard for Binary Floating-Point Arithmetic (IEEE 754) is the most widely-used standard for floating-point computation, and is followed by many CPU and FPU implementations. ... The IEEE Standard for Binary Floating-Point Arithmetic (IEEE 754) is the most widely-used standard for floating-point computation, and is followed by many CPU and FPU implementations. ... PHP is a reflective programming language originally designed for producing dynamic web pages. ... JavaScript is a scripting language most often used for client-side web development. ... // Description Visual Basic for Applications (VBA) is an implementation of Microsofts Visual Basic, an event driven programming language and associated development environment which is built into most Microsoft Office applications (including Apple Mac OS versions), some other Microsoft applications such as Microsoft MapPoint and Microsoft Visio - a former independent... Microsoft SQL Server is a relational database management system (RDBMS) produced by Microsoft. ... This article or section does not adequately cite its references or sources. ... The Microsoft . ... The title given to this article is incorrect due to technical limitations. ...


See also

In mathematics, truncation is the term used for reducing the number of digits right of the decimal point, by discarding the least significant ones. ... A round-off error, also called rounding error, is the difference between the calculated approximation of a number and its exact mathematical value. ... Rounding to n significant figures is a form of rounding. ... The nearest integer function of a real number x is also called the nint or the round function. ... This article or section does not cite its references or sources. ...

External links


  Results from FactBites:
 
Rounding Numbers — FactMonster.com (557 words)
7.8199 rounded to the nearest tenth is 7.8
1.0621 rounded to the nearest hundredth is 1.06
3.8792 rounded to the nearest thousandth is 3.879
  More results at FactBites »

 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m