home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / sci / math / 17280 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.5 KB

  1. Path: sparky!uunet!olivea!sgigate!sgi!wdl1!wdl39!mab
  2. From: mab@wdl39.wdl.loral.com (Mark A Biggar)
  3. Newsgroups: sci.math
  4. Subject: Re: Rounding Rules
  5. Message-ID: <1992Dec21.234114.5766@wdl.loral.com>
  6. Date: 21 Dec 92 23:41:14 GMT
  7. References: <1992Dec20.003018.14325@sol.ctr.columbia.edu> <LOTTO.92Dec21062820@math.math.berkeley.edu>
  8. Sender: news@wdl.loral.com
  9. Organization: Loral Western Development Labs
  10. Lines: 21
  11.  
  12. In article <LOTTO.92Dec21062820@math.math.berkeley.edu> lotto@math.berkeley.edu (Ben Lotto) writes:
  13. >>>>>> On Sun, 20 Dec 1992 00:30:18 GMT, shaw@toadflax.UCDavis.EDU (Rob Shaw) said:
  14. >Rob> What is the rationale behind the following rounding rule?
  15. >Rob> when dealing with 5's followed by all zero's, check the
  16. >Rob> next digit to the left. If it's even, round down; odd,
  17. >Rob> round up.
  18. >I was told way back in my undergraduate days that one should generally
  19. >"round to evens."  Someone recently explained the rationale for this
  20. >as follows.  Suppose we start with 1.49 and round in the traditional
  21. >manner twice.  First we would round to 1.5 and then to 2.  On the
  22. >other hand, if we round just once we get 1.  Rounding to evens
  23. >prevents us from getting different answers.
  24.  
  25. Round to even also has the nice property round(abs(x)) = abs(round(x)), which
  26. given that most floating point representations on computers use  a 
  27. signed-magnitude format means that the rounding hardware doesn't have to
  28. look at the sign bit to do the rounding.
  29.  
  30. --
  31. Mark Biggar
  32. mab@wdl1.wdl.loral.com
  33.