home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.arch
- Path: sparky!uunet!sun-barr!cs.utexas.edu!usc!rpi!psinntp!psinntp!ficc!peter
- From: peter@ferranti.com (peter da silva)
- Subject: Re: integer/BCD/... dollars (was IEEE used for Dollars and Cents)
- Message-ID: <id.W5UU.T7@ferranti.com>
- Organization: Xenix Support, FICC
- References: <2664312@zl2tnm.gen.nz> <27311@dog.ee.lbl.gov>
- Date: Mon, 9 Nov 1992 16:10:26 GMT
- Lines: 36
-
- In article <27311@dog.ee.lbl.gov> torek@horse.ee.lbl.gov (Chris Torek) writes:
- > Sorry, I meant `five digits past the decimal point', the decimal point
- > being dollars. These are apparently called `mills', i.e., thousanths
- > of a cent ($0 + 0 cents + 0.001 cents = 1/1000 cents = 0.00001
- > dollars).
-
- Sorry, a "mil" is 1/1000 of a dollar. Gasoline is sold in even mil amounts
- in this country. The derivation is:
-
- dollar
- dime, from latin for 10, 1/10 dollar
- cent, from latin for 100, 1/100 dollar
- mil, from latin for 1000, 1/1000 dollar
-
- Previously, dollars had been divided in halves, quarters, and eighths (hence
- "pieces of eight"). I don't know if a 125 mil coin (1/8 dollar) was ever
- issued by any bank or mint, but it wouldn't surprise me.
-
- Another consideration is that some goods (stocks, for example) are listed
- down to the 1/8 or even 1/16th of a cent, so you need a word arranged like
- this:
-
- type BIT[4] BCD;
-
- BCD cents[ndigits];
- union {
- BCD mils;
- BIT fraction[4];
- }
-
- Plus, I would guess, a flag indicating the precision class of the value.
- --
- % Peter da Silva % 77487-5012 % +1 713 274 5180 %
- true(<<VV$@\\$'&O 9$O%'$LT$&$"V6"$&$<4$?'&$ #I&&?$=$<<@)24 24 scale 3 21 moveto
- {dup 36 eq{pop not}{dup 7 and 4 sub exch 56 and 8 div 4 sub 2 index{rlineto}{
- rmoveto}ifelse}ifelse}forall stroke pop showpage % Har du kramat din varg idag?
-