# Re: IEEE arithmetic handling

## Dik.Winter@cwi.nl (Dik T. Winter)Mon, 23 Nov 1992 20:32:17 GMT

From comp.compilers

Related articles
[4 earlier articles]
Re: IEEE arithmetic handling jlg@cochiti.lanl.gov (1992-11-17)
Re: IEEE arithmetic handling eggert@twinsun.com (1992-11-17)
Re: IEEE arithmetic handling tmb@arolla.idiap.ch (1992-11-18)
Re: IEEE arithmetic handling bart@cs.uoregon.edu (1992-11-19)
Re: IEEE arithmetic handling bill@amber.csd.harris.com (1992-11-20)
Re: IEEE arithmetic handling bill@amber.csd.harris.com (1992-11-20)
Re: IEEE arithmetic handling Dik.Winter@cwi.nl (1992-11-23)
Re: IEEE arithmetic handling bright@nazgul.uucp (Walter Bright) (1993-01-07)
| List of all articles for this month |

 Newsgroups: comp.compilers From: Dik.Winter@cwi.nl (Dik T. Winter) Organization: CWI, Amsterdam Date: Mon, 23 Nov 1992 20:32:17 GMT References: 92-11-041 92-11-121 Keywords: arithmetic

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
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.
> :-)