in reply to Re^5: Perl can't make some easy arithmetics :(
in thread Perl can't make some easy arithmetics :(
To explain further: use bigint only causes numeric literals to become bigints. It does not change the meaning of operators (like -), no matter what the perldoc might lead you to believe. 0 is a literal, and becomes a bigint. $a and $b are strings, and do not become bigints unless you add 0 to them. Just saying "$a-$b" does not trigger bigint conversion.
Edit: Here's a quick demonstration:
> perl -le 'use bigint; print 22/7; print "22"/"7"' 3 3.14285714285714
|
---|
In Section
Seekers of Perl Wisdom