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