use Math::BigInt; $i = Math::BigInt->new($string); # BINT is a big integer string; in all following cases $i remains unchanged. # All methods except bcmp() return a big integer string, or strings. $i->bneg; # return negative of $i $i->babs # return absolute value of $i $i->bcmp(BINT) # compare $i to BINT; see below for return value $i->badd(BINT) # return sum of BINT and $i $i->bsub(BINT) # return $i minus BINT $i->bmul(BINT) # return $i multiplied by BINT $i->bdiv(BINT) # return $i divided by BINT; see below for return value $i->bmod(BINT) # return $i modulus BINT $i->bgcd(BINT) # return greatest common divisor of $i and BINT $i->bnorm # return normalization of $i ***** '+0' # canonical zero value ' -123 123 123' # canonical value: '-123123123' '1 23 456 7890' # canonical value: '+1234567890' ***** $a = Math::BigInt->new("42 000 000 000 000"); $b = Math::BigInt->new("-111111"); ***** $c = 42000000000000 - -111111; # 42000000111111; ordinary math--$c is a double $c = $a - $b; # "+42000000111111"; $c is now a BigInt object $c = $a - -111111; # "+42000000111111"; $c is now a BigInt object $c = $a->bsub($b); # "+42000000111111"; $c is just a string $c = $a->bsub(-111111); # "+42000000111111"; $c is just a string