home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.compilers
- Path: sparky!uunet!world!iecc!compilers-sender
- From: bill@amber.csd.harris.com (Bill Leonard)
- Subject: Re: IEEE arithmetic handling
- Reply-To: bill@amber.csd.harris.com (Bill Leonard)
- Organization: Harris CSD, Ft. Lauderdale, FL
- Date: Fri, 20 Nov 1992 16:09:35 GMT
- Approved: compilers@iecc.cambridge.ma.us
- Message-ID: <92-11-121@comp.compilers>
- Keywords: arithmetic
- References: <92-11-041@comp.compilers> <92-11-095@comp.compilers>
- Sender: compilers-sender@iecc.cambridge.ma.us
- Lines: 31
-
- > jlg@cochiti.lanl.gov (J. Giles) writes:
- > This is easily accomplished. Let `b' be the base of your floating point
- > representation and let `p' be the number of digits in your significand.
- > Then, output followed by input is the identity if:
- >
- > (m-1) p
- > 10 >= b - 1
- >
- > Where `m' is the number of decimal digits output.
-
- This doesn't seem to work. Take an example: let b=2, p=4. Thus
- p
- b - 1 = 15, so m=3. Now consider the binary number 1.001, which has
- 4 binary digits (as dicated by p=4). This number, in decimal, is exactly
- 1.125, which requires 4 decimal digits, thus exceeding the number m.
-
- I don't believe any formula like the above can work if b contains a factor
- that is not also a factor of 10 -- for instance, a b of 3 would never
- work, since there are fractions in base 3 that are non-terminating
- decimals. (Of course, a computer using base 3 would be pretty strange.
- :-)
-
- --
- Bill Leonard
- Harris Computer Systems Division
- 2101 W. Cypress Creek Road
- Fort Lauderdale, FL 33309
- bill@ssd.csd.harris.com
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-