summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorMike Guy <mjtg@cam.ac.uk>2002-09-26 14:20:45 +0100
committerhv <hv@crypt.org>2002-10-02 13:43:26 +0000
commit2cdc098b0ca3aa6472d96981cd6e2bbef5e34f6a (patch)
tree7ce6f4e53e0795671c4b687c65109bf490f7293e /pod
parent97828cef4d4cd22b548b8ec430d2e0e28ea8ae8c (diff)
downloadperl-2cdc098b0ca3aa6472d96981cd6e2bbef5e34f6a.tar.gz
add precedence warning for bitwise docs
Subject: [PATCH] Bug in ARM's floating point emulation - Need someone, really... Message-Id: <E17uXdN-0003ko-00@libra.cus.cam.ac.uk> p4raw-id: //depot/perl@17955
Diffstat (limited to 'pod')
-rw-r--r--pod/perlop.pod16
1 files changed, 13 insertions, 3 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod
index 8af2d5b93b..9bce6c26cc 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -336,17 +336,27 @@ by the current locale if C<use locale> is in effect. See L<perllocale>.
=head2 Bitwise And
-Binary "&" returns its operators ANDed together bit by bit.
+Binary "&" returns its operands ANDed together bit by bit.
(See also L<Integer Arithmetic> and L<Bitwise String Operators>.)
+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<Integer Arithmetic> and L<Bitwise String Operators>.)
-Binary "^" returns its operators XORed together bit by bit.
+Binary "^" returns its operands XORed together bit by bit.
(See also L<Integer Arithmetic> and L<Bitwise String Operators>.)
+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,