Skip to content

Instantly share code, notes, and snippets.

@jul
Created July 10, 2012 14:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jul/3083565 to your computer and use it in GitHub Desktop.
Save jul/3083565 to your computer and use it in GitHub Desktop.
pas fait de perl depuis longtemps//forgot how to increment in perl
#!/usr/bin/perl
sub a_p_p {
($x,$n)=@_;
return ($x>>$n)%2 && a_p_p($x^(1<<$n),a_p_p($n)) || $x|($x^(1<<$n))
}
a_p_p($A)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment