Variable size/Set: Difference between revisions

m
forgot the "3."
m (forgot the "3.")
Line 405:
<lang Phix>include mpfr.e -- requires 0.8.0+
string nines = repeat('9',1001) -- +1 for the "3."
mpz ndp = mpz_init(nines) -- mpz_init(nines,33223326) would be identical
integer precision = mpz_sizeinbase(ndp,2) -- 33223326
mpfr pi = mpfr_init(0,precision) -- or just hard-code that 33223326
mpfr_const_pi(pi)
mpfr_printf(1,"PI with 1000 decimals: %.1000RDf\n\n",pi)</lang>
7,803

edits