This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Remove GMP in favor of MPFR


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]