diff options
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/expressions.rst | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index ea2bb1a..21bd750 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -811,9 +811,9 @@ Unary arithmetic operations .. index:: triple: unary; arithmetic; operation - triple: unary; bit-wise; operation + triple: unary; bitwise; operation -All unary arithmetic (and bit-wise) operations have the same priority: +All unary arithmetic (and bitwise) operations have the same priority: .. productionlist:: u_expr: `power` | "-" `u_expr` | "+" `u_expr` | "~" `u_expr` @@ -830,8 +830,8 @@ The unary ``+`` (plus) operator yields its numeric argument unchanged. .. index:: single: inversion -The unary ``~`` (invert) operator yields the bit-wise inversion of its plain or -long integer argument. The bit-wise inversion of ``x`` is defined as +The unary ``~`` (invert) operator yields the bitwise inversion of its plain or +long integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. It only applies to integral numbers. .. index:: exception: TypeError @@ -944,10 +944,10 @@ Negative shift counts raise a :exc:`ValueError` exception. .. _bitwise: -Binary bit-wise operations -========================== +Binary bitwise operations +========================= -.. index:: triple: binary; bit-wise; operation +.. index:: triple: binary; bitwise; operation Each of the three bitwise operations has a different priority level: @@ -956,20 +956,20 @@ Each of the three bitwise operations has a different priority level: xor_expr: `and_expr` | `xor_expr` "^" `and_expr` or_expr: `xor_expr` | `or_expr` "|" `xor_expr` -.. index:: pair: bit-wise; and +.. index:: pair: bitwise; and The ``&`` operator yields the bitwise AND of its arguments, which must be plain or long integers. The arguments are converted to a common type. .. index:: - pair: bit-wise; xor + pair: bitwise; xor pair: exclusive; or The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, which must be plain or long integers. The arguments are converted to a common type. .. index:: - pair: bit-wise; or + pair: bitwise; or pair: inclusive; or The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which |