home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / arch / 10451 < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.7 KB  |  40 lines

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!rde!ksmith!keith
  3. From: keith@ksmith.uucp (Keith Smith)
  4. Subject: Re: IEEE used for Dollars and Cents
  5. Organization: Keith's Computer, Hope Mills, NC
  6. Date: Thu, 05 Nov 92 13:33:22 GMT
  7. Message-ID: <1992Nov05.133322.1758@ksmith.uucp>
  8. References: <1917307@zl2tnm.gen.nz>
  9. Lines: 29
  10.  
  11. In article <1917307@zl2tnm.gen.nz> don@zl2tnm.gen.nz (Don Stokes) writes:
  12. >kludge@grissom.larc.nasa.gov (Scott Dorsey) writes:
  13. >> dollars and cents.  Why bother?  Use a fixed point format with two or three
  14. >> digits after the decimal place.  You save storage space (why store an exponent
  15. >> since it's going to be the same three values everywhere?), you save compute
  16. >
  17. >Except that most machines only handle 32 bit or less integers cleanly, and
  18. >with two decimal places that's only up to $21,474,836.47 (assuming signed
  19. >integers).  Alas, totals frequently exceed that amount (and even
  20. >transactions in some applications).
  21. >
  22. >Machines that can handle 64 bit integers cleanly will make this problem
  23. >largely go away.  8-)
  24.  
  25. A pretty darn big assumption that you only need 2 or 3 decimal places of
  26. precision in a financial calculation.  We have some 4 decimal place
  27. multiplication here.
  28.  
  29. Why doesen't someone build a bcd or bcddouble type INTO the 'C' compiler
  30. with a higher order than float.  Numbers could be 8 or 16 bytes, 2 bytes
  31. of sign/exponent, and eith 7 or 15 bytes of mantissa, (14 or 30
  32. *DECIMAL* as in BASE 10 places of precision).
  33.  
  34. Why don't *I*?  Well,  I started to once, but the compilers are changing
  35. faster than I can code.
  36. -- 
  37. Keith Smith          uunet!ksmith!keith            5719 Archer Rd.
  38. Digital Designs      BBS 1-919-423-4216            Hope Mills, NC 28348-2201
  39. Somewhere in the Styx of North Carolina ...
  40.