Bitwise operations: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (→{{header|Perl6}}: Added perl 6 solution) |
(→{{header|PARI/GP}}: move bitneg to lang) |
||
Line 1,017: | Line 1,017: | ||
=={{header|PARI/GP}}== |
=={{header|PARI/GP}}== |
||
Pari does not support bitwise rotations |
Pari does not support bitwise rotations, which have no obvious meaning with arbitrary-precision integers. See also <code>bitnegimply</code> for another bitwise operator. For shifts, see also <code>shiftmul</code>. |
||
<lang parigp>bo(a,b)={ |
<lang parigp>bo(a,b)={ |
||
print("And: "bitand(a,b)); |
print("And: "bitand(a,b)); |
||
print("Or: "bitor(a,b)); |
print("Or: "bitor(a,b)); |
||
print("Not: "bitneg(a)); |
|||
print("Xor: "bitxor(a,b)); |
print("Xor: "bitxor(a,b)); |
||
print("Left shift: ",a<<b); |
print("Left shift: ",a<<b); |