Screw the benchmarks! In fact, screw math!
sub is_odd { my $int = shift; if ( $int =~ /\D/ ) { die "Not an integer, dummy!" } substr($int,-1) =~ /[13579]/; }
Yes, it's a joke.
In reply to Re: &1 is no faster than %2 when checking for oddness. Oh well.
by radiantmatrix
in thread &1 is no faster than %2 when checking for oddness. Oh well.
by diotalevi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |