From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_05,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site zuring.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!mcvax!zuring!dik From: dik@zuring.UUCP Newsgroups: net.lang.ada Subject: Re: floating point number radix Message-ID: <247@zuring.UUCP> Date: Sun, 20-Oct-85 16:17:18 EDT Article-I.D.: zuring.247 Posted: Sun Oct 20 16:17:18 1985 Date-Received: Tue, 22-Oct-85 05:56:35 EDT References: <8510190414.AA24234@UCB-VAX> Reply-To: dik@zuring.UUCP (Dik T. Winter) Organization: CWI, Amsterdam Apparently-To: rnews@mcvax.LOCAL List-Id: In article <8510190414.AA24234@UCB-VAX> BRYAN@SU-SIERRA.ARPA (Doug Bryan) writes: >[3.5.7(6)] >The reference manual states that the minimum number of binary digits, B, >required after the point in the binary mantissa of a floating point >number is... > > ceiling (D * ln(10)/ln(2) + 1.0) > >where D is the minimal number of decimal digits in the decimal mantissa. > >Consider D = 3... > > ceiling (3 * ln(10)/ln(2) + 1.0) = ceiling (10.9657) = 11 > >But... is not 10 binary digits sufficient to represent 3 decimal digits? > 2**(-10) < 10**(-3) >We think the "+ 1.0" in the above expression can be removed. > >doug bryan and geoff mendal > No. The relative precision of the binary representation should not be less than that of the decimal representation. For difits 3 the relative precision of the decimal representation ranges from 1 in 500 to 1 in 999, and with 10 bits for the binary representation from 1 in 512 to 1 in 1023. And indeed we find the following: 819/8192 = .099975 818/8192 = .099853 817/8192 = .099731 So there is no representation for .0998, a valid digits 3 number. -- dik t. winter, cwi, amsterdam, nederland UUCP: {seismo|decvax|philabs}!mcvax!dik