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

H8H h8h at
Wed Jan 28 17:09:20 UTC 2015

--- Now for the list :) ----
I see that i.e. python has the same behaviour:

from decimal import *
getcontext().prec = 485
Decimal(6.4) / Decimal(3.4)
Decimal("6.4") / Decimal("3.4")

Thanks to you I understand the nature of binary floating-point better.

But could you tell me some use cases for which it is better to create a
mpf_class from a double instead of creating it from a string to have a
higher precision? Has it a better performance? Is it better for lower

For me it makes no sense to create a mpf_class from a double and have a
very poor precision.

Thanks so far for your thoughts.


More information about the gmp-discuss mailing list