home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!decwrl!decwrl!waikato.ac.nz!comp.vuw.ac.nz!zl2tnm!toyunix!don
- Newsgroups: comp.arch
- Subject: Re: integer/BCD/... dollars (was IEEE used for Dollars and Cents)
- Message-ID: <2664312@zl2tnm.gen.nz>
- From: don@zl2tnm.gen.nz (Don Stokes)
- Date: 8 Nov 92 10:54:34 GMT
- Sender: news@zl2tnm.gen.nz (GNEWS Version 2.0 news poster.)
- Distribution: world
- Organization: The Wolery
- Lines: 38
-
- torek@horse.ee.lbl.gov (Chris Torek) writes:
- > Signed integers are not an absolute must, but precision greater than
- > one penny is; most businesses seem to keep records to five digits or so.
-
- Figures are only _published_ to five digits or so. Bookkeeping must be
- to the last cent, and auditors get upset if systems don't balance. I've
- seen programmers work their guts out to persuade things to balance to the
- last few cents, usually because of floating point arithmetic on dollar
- (rather than cent) values....
-
- Think about it: keeping only five digits of a billion dollar bottom line
- could hide some pretty major fraud....
-
- I stuck to signed integers (a) for generality, and (b) because the places
- where business bignums turn up are in things like balances and profit
- figures, which can (unfortunately) be negative.
-
- > >Machines that can handle 64 bit integers cleanly will make this problem
- > >largely go away. 8-)
- >
- > Hm, my kitchen arithmetic says that 2^64 only represents 1844 trillion
- > dollars in mills. At its current growth rate, the U.S. national debt
- > will exceed this well within the next century. Of course, by then the
- > nation itself will be completely bankrupt, so this will not matter. :-)
-
- My bc says that it's more like $184,647 trillion dollars. That makes the US
- national debt a potential problem if you calculate it in Bolivian pesos. 8-)
-
- > Current 32-bit microprocessors are capable of handling 64-bit quantities
- > moderately well. Current versions of GCC support them directly. 64-bit
- > integer arithmetic is well on its way to becoming established practise.
-
- And about time too.
-
- --
- Don Stokes, ZL2TNM (DS555) don@zl2tnm.gen.nz (home)
- Network Manager, Computing Services Centre don@vuw.ac.nz (work)
- Victoria University of Wellington, New Zealand +64-4-495-5052
-