diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-07 14:21:48 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-07 14:21:48 +0000 |
commit | 1ae175c8d48ec3f9bff4739583753d9b46939a5f (patch) | |
tree | 001c175a9a3b91de819fb060ea8e906d4d665632 /pod/perlop.pod | |
parent | b1524f1739a84392b9443982741b38ce39195b6c (diff) | |
download | perl-1ae175c8d48ec3f9bff4739583753d9b46939a5f.tar.gz |
tweak doc on bitwise ops
p4raw-id: //depot/perl@2824
Diffstat (limited to 'pod/perlop.pod')
-rw-r--r-- | pod/perlop.pod | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod index 01c5d0ef51..0b848ad97d 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<or> and B<xor> ops will act as if the shorter operand had additional -zero bits on the right, while the B<and> 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<bytes>. # 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<perlfunc/vec> 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 |