bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fw: maybey an error in mpf_cmp


From: Toine Bommelijn
Subject: Fw: maybey an error in mpf_cmp
Date: Tue, 26 Nov 2002 11:16:01 +0100

----- Original Message -----
From: "Toine Bommelijn" <address@hidden>
To: "Paul Zimmermann" <address@hidden>
Sent: Tuesday, November 26, 2002 9:16 AM
Subject: Re: maybey an error in mpf_cmp


> Thanks Paul,
>
> But, the compare function should still work in my opinion although both
> numbers have different internal representations ... what else is the use
of
> the compare function.
>
> Regards,
> Toine Bommelijn
>
> ----- Original Message -----
> From: "Paul Zimmermann" <address@hidden>
> To: <address@hidden>
> Cc: <address@hidden>
> Sent: Monday, November 25, 2002 6:36 PM
> Subject: Re: maybey an error in mpf_cmp
>
>
> > > I suspect that there is a problem with the function "mpf_cmp". I
compare
> two
> > > floating-point values, the left argument is the result of the
> calculation
> > > truncate((1/12 * 1) * 100) / 100 and contains the value 0.08 and the
> other
> > > value that has been directly converted from a string and is also 0.08.
> >
> > The problem is that 8/100 = 2/25 is not exactly representable in binary,
> > so you may have two different approximations of 8/100 that give the same
> > 2-digit output.
> >
> > Paul Zimmermann
> >
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]