home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.compilers
- Path: sparky!uunet!world!iecc!compilers-sender
- From: Dik.Winter@cwi.nl (Dik T. Winter)
- Subject: Re: IEEE arithmetic handling
- Reply-To: Dik.Winter@cwi.nl (Dik T. Winter)
- Organization: CWI, Amsterdam
- Date: Mon, 23 Nov 1992 20:32:17 GMT
- Approved: compilers@iecc.cambridge.ma.us
- Message-ID: <92-11-135@comp.compilers>
- References: <92-11-041@comp.compilers> <92-11-121@comp.compilers>
- Keywords: arithmetic
- Sender: compilers-sender@iecc.cambridge.ma.us
- Lines: 36
-
-
- 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.
-
- bill@amber.csd.harris.com (Bill Leonard) writes:
- > 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.
-
- No problem, you output 1.12 or 1.13 whatever you fancy. Now when you read
- that back in you get your original back. Unless your read routines are
- wrong of course and read 1.12 or 1.13 back in as 1.25 or 1.00. That is
- the major part, not that output is exact but that output followed by input
- is exact.
-
- > (Of course, a computer using base 3 would be pretty strange.
- > :-)
-
- On occasion on alt.folklore.computers you will read about that Russian
- ternary beast.
- --
- dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland
- home: bovenover 215, 1025 jn amsterdam, nederland; e-mail: dik@cwi.nl
-
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-