Skip to content

Instantly share code, notes, and snippets.

@bdw
Created October 6, 2018 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdw/f1c4db2a029c8e601025d0caa23ade0c to your computer and use it in GitHub Desktop.
Save bdw/f1c4db2a029c8e601025d0caa23ade0c to your computer and use it in GitHub Desktop.
shift test
#!/usr/bin/env nqp
sub shifter(int $x, int $y) {
nqp::abs_i(nqp::bitshiftl_i($x, $y));
}
my int $i := 0;
while ($i++ < 1_000_000) {
my $x := shifter(10,3);
if (shifter(10,3) != 80) {
nqp::die("OHNO $i $x");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment