Bitwise operations: Difference between revisions

Content added Content deleted
(→‎{{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 or negations; these have no obvious meaning with arbitrary-precision integers. See also <coe>bitneg</code> and <code>bitnegimply</code> for more bitwise operators. For shifts, see also <code>shiftmul</code>.
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);