rsFalse has asked for the wisdom of the Perl Monks concerning the following question:
Today I spend time to understand why do I get wrong answers, and I don't know an answer. Later I tried and found how to overcome problem: use bigint and add zeroes.
See this:
while(<>){ ($a, $b)=split/ /; print $a - $b, " "; print (($a+0)-($b+0), " "); use bigint; print $a - $b, " "; print (($a+0)-($b+0), "\n"); }
STDIN: 9 7 900000000000000009 900000000000000007 STDOUT: 2 2 2 2 0 0 0 2
Back to
Seekers of Perl Wisdom