Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Math With Big Numbers

by danaj (Friar)
on Mar 26, 2019 at 23:20 UTC ( [id://1231723] : note . print w/replies, xml ) Need Help??


in reply to Math With Big Numbers

For fun on the quadmath perl I use:

$ perl -V | grep nvsize nvsize=16 $ perl -E 'say 6**25; say ~0' 28430288029929701376 18446744073709551615

Quadmath works in this case, but of course you really want to use bigint, Math::BigInt, Math::GMP, Math::GMPz, etc. as this is just putting it off (e.g. 6^42 is exact but 6^43 is not).