|
|
| P is for Practical | |
| PerlMonks |
Re: log() and int() problemby moritz (Cardinal) |
| on Dec 25, 2012 at 17:02 UTC ( #1010277=note: print w/ replies, xml ) | Need Help?? |
|
log returns a floating-point number, so the results are prone to floating-point inaccuracies:
A safer test is something like this here, which only uses integers:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||