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