From 2bd3a7664df2c5d3200d782ae4ec2dfccd71bc89 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Thu, 26 Apr 2018 16:22:17 -0700 Subject: [PATCH] documentation for bitwise operators --- doc/script-reference/types.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/script-reference/types.rst b/doc/script-reference/types.rst index 3d6f74aef0..fe77ece90c 100644 --- a/doc/script-reference/types.rst +++ b/doc/script-reference/types.rst @@ -91,6 +91,10 @@ Here is a more detailed description of each type: type, but a unary plus or minus applied to a "count" results in an "int". + In addition, "count" types support bitwise operations. You can use + ``&``, ``|``, and ``^`` for bitwise ``and'', ``or'', and ``xor''. You + can also use ``~`` for bitwise (one's) complement. + .. bro:type:: double A numeric type representing a double-precision floating-point @@ -592,6 +596,9 @@ Here is a more detailed description of each type: The resulting vector of bool is the logical "and" (or logical "or") of each element of the operand vectors. + Vectors of type ``count`` can also be operands for the bitwise and/or/xor + operators, ``&``, ``|`` and ``^``. + See the :bro:keyword:`for` statement for info on how to iterate over the elements in a vector.