No need to resort to "big int" modules if you only need 10 digits. Every version of Perl can do arithmatic with exact precision on integers at least to 15 digits. If you divide and wish to get an integer result, then use int which removes the fractional part of the number but doesn't truncate the value to fit in an IV.
That is, a C data type of "double" (NV) can handle integers (and rather large ones at that) quite well and Perl does this. And Perl's int() doesn't convert to a C data type like "int" or "long" (IV).
- tye
In reply to Re^2: Arithmetic on numbers bigger than 1<<31 (not so big)
by tye
in thread Arithmetic on numbers bigger than 1<<31
by thor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |