in reply to A mod2 Machine.
using floats to compute modulo does not seem reasonable to me.I only included this:
becausemy $n = 534587; print "even\n" if($n % 2 == 0); # modulo operator of possibly a flo +at or possibly an integer (*)
use integer; my $n = 534587; print "even\n" if($n & 1 == 0); # checking LSB with Bitwise And on +an integer
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A mod2 Machine.
by code-ninja (Scribe) on Jul 13, 2013 at 12:34 UTC |