The way how I create my mpf_class effects the result after a arithmetic operation
H8H
h8h at dev-nu11.de
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('1.882352941176470741....')
Decimal("6.4") / Decimal("3.4")
Decimal('1.882352941176470588....')
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
precisions?
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.
Cheers
More information about the gmp-discuss
mailing list