Why does the below give two different answers? The first usage returns the expected correct value (1), while the second returns 0. Perl 5.8.8 Win32.
Thanks in advance.
Very confused!
use strict; my $num=3891.0; my $answer=$num % 5; print "num is $num answer is $answer \n"; my $num=38.91 * 100; my $answer=$num % 5; print "num is $num answer is $answer \n";
In reply to Modulus strangeness (%) by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |