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
In reply to Re: A mod2 Machine.
by zork42
in thread A mod2 Machine.
by code-ninja
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |