From: Gurusamy Sarathy Date: Sun, 7 Feb 1999 14:21:48 +0000 (+0000) Subject: tweak doc on bitwise ops X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ae175c8d48ec3f9bff4739583753d9b46939a5f;p=p5sagit%2Fp5-mst-13.2.git tweak doc on bitwise ops p4raw-id: //depot/perl@2824 --- diff --git a/pod/perlop.pod b/pod/perlop.pod index 01c5d0e..0b848ad 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -1667,9 +1667,10 @@ Bitstrings of any size may be manipulated by the bitwise operators (C<~ | & ^>). If the operands to a binary bitwise op are strings of different sizes, -B and B ops will act as if the shorter operand had additional -zero bits on the right, while the B op will act as if the longer -operand were truncated to the length of the shorter. +B<|> and B<^> ops will act as if the shorter operand had additional +zero bits on the right, while the B<&> op will act as if the longer +operand were truncated to the length of the shorter. Note that the +granularity for such extension or truncation is one or more I. # ASCII-based examples print "j p \n" ^ " a h"; # prints "JAPH\n" @@ -1690,6 +1691,9 @@ operation you intend by using C<""> or C<0+>, as in the examples below. $baz = 0+$foo & 0+$bar; # both ops explicitly numeric $biz = "$foo" ^ "$bar"; # both ops explicitly stringy +See L for information on how to manipulate individual bits +in a bit vector. + =head2 Integer Arithmetic By default Perl assumes that it must do most of its arithmetic in