[PATCH] Remove GMP in favor of MPFR

Steve Kargl sgk@troutmask.apl.washington.edu
Sun Jul 4 17:30:00 GMT 2004


On Sun, Jul 04, 2004 at 05:17:32PM +0100, Paul Brook wrote:
> 
> I think these numbers come from gcc/real.c. However reading a bit further 
> uncovers the following comment:
>       /* Recall that IEEE numbers are interpreted as 1.F x 2**exp,
>          whereas the intermediate representation is 0.F x 2**exp.
>          Which means we're off by one.  */
> 
> There's also Note 13.4 from the standard, which looks a lot like ieee single 
> precision format.
> 

In learning what MPFR does with underflow, I wrote a simple
program that repeated divided 1 by 10.  Here's a small
sampling of MPFR's binary and decimal output:

1.10011001100110011001101e-4 1.000000e-1
1.01000111101011100001010e-7 1.000000e-2
1.00000110001001001101110e-10 9.999999e-4
1.10100011011011100010110e-14 9.999999e-5

It appears MPFR will give us 1.F x 2**exp, which is the behavior
specified by the Fortran standard. 

-- 
Steve



More information about the Fortran mailing list