home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / rexx / 1415 < prev    next >
Encoding:
Text File  |  1992-12-16  |  1.1 KB  |  31 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!spool.mu.edu!uwm.edu!psuvax1!psuvm!auvm!VNET.IBM.COM!MFC
  3. Message-ID: <REXXLIST%92121605082447@UGA.CC.UGA.EDU>
  4. Newsgroups: comp.lang.rexx
  5. Date:         Wed, 16 Dec 1992 10:06:22 GMT
  6. Sender:       REXX Programming discussion list <REXXLIST@UGA.BITNET>
  7. From:         Mike Cowlishaw <mfc@VNET.IBM.COM>
  8. Subject:      Even/Odd rounding
  9. Comments: To: rexxlist@uga.uga.edu
  10. Lines: 19
  11.  
  12. Consider:
  13.  
  14.   numeric digits 9
  15.   say 0 + 888888888.5000000000xxxx000000001
  16.  
  17. (where xxxx is an arbitrary number of zeros).  This number should
  18. always be rounded up, never down, as should:
  19.  
  20.   say 0 + 888888888.59999999xxxx9999999
  21.  
  22. (where xxxx is an arbitrary number of nines).  In other words, the
  23. even/odd rule can only be applied if you have inspected all digits
  24. to the right and confirmed that they are zeros.  If you do inspect
  25. them, then your results are influenced by more than DIGITS()+1
  26. digits, and hence don't follow the principles of NUMERIC DIGITS.
  27. If you don't inspect them, then quite large errors occur (as in the
  28. second case above).
  29.  
  30. Mike
  31.