bug-gmp
[Top][All Lists]
Advanced

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

Re: maybey an error in mpf_cmp


From: Paul Zimmermann
Subject: Re: maybey an error in mpf_cmp
Date: Mon, 25 Nov 2002 18:36:00 +0100

> 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]