雖然日常生活中的數值運動,大多採用四拾五入法,但電腦中常使用四拾六入法來運算。

參考說明網址:http://www.daviddarling.info/encyclopedia/ETEmain.html

The Encyclopedia of Astrobiology, Astronomy, and Spaceflight

Banker's rounding
For banking or scientific purposes it's often considered correct to round something 0.5 to the nearest even number, i.e. not always upward). For instance, 5.5 rounds to 6, but 12.5 rounds to 12. This method avoids introducing a bias to a large set of numbers, by rounding up more or less as often as rounding down. Unfortunately, at a lower level, it is often taught to round something 0.5 upward all the time.

  • Banker's rounding: the value is rounded to the nearest even number. Also known as "Gaussian rounding", and, in German, "mathematische Rundung".
  • Standard rounding: the value is rounded to the nearest number (be it odd or even). In German it is known as "kaufmännische Rundung".
  • 例如 :

Unrounded
   54.1754
 343.2050
+ 106.2038
---------------
 503.5842

2 digits"Standard" rounding
     54.18
   343.21
+ 106.20
------------
   503.59

2 digits"Gaussian" rounding
     54.18
   343.20
+ 106.20
------------
   503.58

Unrounded
    27.25
    27.45
+ 27.55
-----------
    82.25

1 digits"Standard" rounding
   27.3
   27.5
+ 27.6
---------
   82.4

1 digits"Gaussian" rounding
    27.2
    27.4
+ 27.6
----------
   82.2 

arrow
arrow
    全站熱搜

    vincent 發表在 痞客邦 留言(0) 人氣()