Created
July 10, 2012 14:18
-
-
Save jul/3083565 to your computer and use it in GitHub Desktop.
pas fait de perl depuis longtemps//forgot how to increment in perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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