For Programmers: Free Programming Magazines  


Home > Archive > Fortran > June 2004 > Re: g77 : bad real*8 registration : is a bug ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: g77 : bad real*8 registration : is a bug ?
Robert Corbett

2004-06-10, 3:58 pm

Patrick GOLDBRONN <patrick.goldbronn@cea.fr> wrote in message news:<ca4gj7$h8v$1@ellebore.saclay.cea.fr>...
> Klaus Wacker wrote:
>
> I realy want to use int(), not nint().
>
> But is not int() in fact :
>
> On sun (g77 3.0.3) , I write 0.85, 0.85*60 and 0.85*60-51
> a=.84999999999999997780E+00
> a*b=.51000000000000000000E+02
> a*b-51= 0.
>
> Same on linux (g77 3.0.4) :
> a=.84999999999999997780E+00
> a*b=.51000000000000000000E+02
> a*b-51= -1.33226763E-15


You might be taking advantage of the extra precision offered by the x87
instructions. The x87 instructions evaluate floating-point expressions
to 64-bit precision. Double-precision expressions on SPARC are
evaluated to 53-bit precision. Given the magnitude of the result of
the product, that is about the difference shown in the result of the
difference.

Sincerely,
Bob Corbett
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com