From: Mike Guy Date: Thu, 26 Sep 2002 13:20:45 +0000 (+0100) Subject: add precedence warning for bitwise docs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2cdc098b0ca3aa6472d96981cd6e2bbef5e34f6a;p=p5sagit%2Fp5-mst-13.2.git add precedence warning for bitwise docs Subject: [PATCH] Bug in ARM's floating point emulation - Need someone, really... Message-Id: p4raw-id: //depot/perl@17955 --- diff --git a/pod/perlop.pod b/pod/perlop.pod index 8af2d5b..9bce6c2 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -336,17 +336,27 @@ by the current locale if C is in effect. See L. =head2 Bitwise And -Binary "&" returns its operators ANDed together bit by bit. +Binary "&" returns its operands ANDed together bit by bit. (See also L and L.) +Note that "&" has lower priority than relational operators, so for example +the brackets are essential in a test like + + print "Even\n" if ($x & 1) == 0; + =head2 Bitwise Or and Exclusive Or -Binary "|" returns its operators ORed together bit by bit. +Binary "|" returns its operands ORed together bit by bit. (See also L and L.) -Binary "^" returns its operators XORed together bit by bit. +Binary "^" returns its operands XORed together bit by bit. (See also L and L.) +Note that "|" and "^" have lower priority than relational operators, so +for example the brackets are essential in a test like + + print "false\n" if (8 | 2) != 10; + =head2 C-style Logical And Binary "&&" performs a short-circuit logical AND operation. That is,