The way how I create my mpf_class effects the result after a arithmetic operation

Case Van Horsen casevh at gmail.com
Thu Jan 29 00:30:45 UTC 2015


On Wed, Jan 28, 2015 at 2:02 PM, Hans Aberg <haberg-1 at telia.com> wrote:
>
>> On 28 Jan 2015, at 18:09, H8H <h8h at dev-nu11.de> wrote:
>>
>> I see that i.e. python has the same behaviour:
>
> That may be the case because they use the GMP, MPFR and MPC libraries! :-)
The Decimal type in Python is a true radix-10 floating point type.
Early versions were written in Python but later versions are
implemented in C. 64-bit binary values are converted exactly by
creating a result with 53 decimal digits of precision. If an
representation error is introduced when the 64-bit value was created,
it will be propagated to the Decimal value.

Support for the GMP, MPFR, and MPC libraries are provided by gmpy2
library which I maintain.

casevh


More information about the gmp-discuss mailing list