Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Dividing and formatby tadman (Prior) |
on Nov 27, 2003 at 17:46 UTC ( [id://310567]=note: print w/replies, xml ) | Need Help?? |
It's probably storing "127" as 126.9999999999999 which rounds down with the int function. Aren't floating point numbers fun?
The documentation for int suggests that the POSIX::floor function is a better selection for this kind of work.
In Section
Seekers of Perl Wisdom
|
|