Message321683
OK, that makes sense to me. Given that, there'd be two changes proposed.
1. Replace the opening paragraph of https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types (the one I originally quoted when opening this issue) with the text:
=====================
Bitwise operations only make sense for integers. The result of bitwise operations is calculated as though carried out in two's complement with an infinite number of sign bits.
=====================
2. Add a new footnote ``(4)`` to the table for the ``|``, ``^``, and ``&`` entries that reads:
=====================
4. Performing these calculations with at least one extra sign extension bit in the internal representation (a working bit-width of ``1 + max(x.bit_length(), y.bit_length()`` or more) is sufficient to get the same result as if there were an infinite number of sign bits.
===================== |
|
Date |
User |
Action |
Args |
2018-07-15 08:20:26 | ncoghlan | set | recipients:
+ ncoghlan, tim.peters, mark.dickinson, docs@python, martin.panter, wolma, CuriousLearner |
2018-07-15 08:20:26 | ncoghlan | set | messageid: <1531642826.22.0.56676864532.issue29710@psf.upfronthosting.co.za> |
2018-07-15 08:20:26 | ncoghlan | link | issue29710 messages |
2018-07-15 08:20:26 | ncoghlan | create | |
|