in reply to Re: Integer overflow question
in thread Integer overflow question

Someone looking at your example could think that use bigint alters how many digits print outputs, but that would be wrong. Here's a better example:

{ $a = 2**59; # Saved as a limited precision float. $b = 2**59 + 1; # Saved as a limited precision float. print($a, $/); # Prints "5.76460752303423e+017". print($b, $/); # Prints "5.76460752303423e+017". print($b-$a, $/); # Prints "0". } { use bigint; $a = 2**59; # Saved as an unlimited precision int. $b = 2**59 + 1; # Saved as an unlimited precision int. print($a, $/); # Prints "576460752303423488". print($b, $/); # Prints "576460752303423489". print($b-$a, $/); # Prints "1". }