format (printf like routines)
Root Boy Jim
rbj at icst-cmr.ARPA
Sat Jul 26 05:29:51 AEST 1986
With respect to 10**38 being inaccurate:
Geoff is correct. Since 10 is not a power of two, to represent 10**38
exactly *does* require many many bits of mantissa (89 to be exact).
*However*, on the VAX, thanks to hardware magic like guard digits,
a loop of 38 "* 10.0"s *does* yield the exact representation of
10**38 within the constraints of a (double).
A subsequent loop of 38 "/ 10.0"s even gives you 1.0.
Perhaps I should have made myself clear. IEEE format does not require
that every integer in it's range be represented exactly. I do agree that
10**38 requires something like 89 bits, but 10**38 - 1 requires more,
something on the order of 126 bits. Even with Cray 128 bit doubles,
some of the bits have to go to the exponent, so it can't represent
all the integers in its range either.
Rick Genter BBN Laboratories Inc.
(617) 497-3848 10 Moulton St. 6/512
rgenter at labs-b.bbn.COM Cambridge, MA 02238
rgenter at bbn-labs-b.ARPA linus!rgenter%BBN-LABS-B.ARPA (UUCP)
(Root Boy) Jim Cottrell <rbj at icst-cmr.arpa>
A can of ASPARAGUS, 73 pigeons, some LIVE ammo, and a FROZEN DAQUIRI!! ...
... cannot represent it either.
More information about the Comp.lang.c
mailing list