Jan-08-2018, 01:22 PM
(Jan-08-2018, 09:44 AM)Gribouillis Wrote: [ -> ]You are correct. I had meant to keep the values as integers.(Jan-08-2018, 05:08 AM)casevh Wrote: [ -> ]Unfortunately, your fraction only provides 53 bits of accuracy, not the 64 bits required by long double.This computation is not correct, because when you writea=gmpy2.mpfr(8552228672519733982877442985294966266405.0)
, the python interpreter converts the number tofloat
, which loses precision. You need to use some string"8552228672519733982877442985294966266405.0"
.
The following code using the bigfloat library confirms Skaperen's values
>>> from bigfloat import * >>> with precision(133): ... print(const_pi().as_integer_ratio()) ... (8552228672519733982877442985294966266405, 2722258935367507707706996859454145691648)
@Skaperen, please accept my apologies.
casevh