Message 288890 - Python tracker

Message288890

Author ncoghlan
Recipients docs@python, ncoghlan
Date 2017-03-03.14:38:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488551919.31.0.20533072889.issue29710@psf.upfronthosting.co.za>
In-reply-to
Content
The docs on bitwise operations at https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types include the caveated sentence:

    Negative numbers are treated as their 2’s complement value (this assumes that there are enough bits so that no overflow occurs during the operation).

This sentence isn't correct now that integers are always arbitrary length. The bitwise inversion will never overflow, and is instead calculated as "-(n+1)" rather than literally flipping bits in the representation: https://docs.python.org/3/reference/expressions.html#unary-arithmetic-and-bitwise-operations
History
Date User Action Args
2017-03-03 14:38:39ncoghlansetrecipients: + ncoghlan, docs@python
2017-03-03 14:38:39ncoghlansetmessageid: <1488551919.31.0.20533072889.issue29710@psf.upfronthosting.co.za>
2017-03-03 14:38:39ncoghlanlinkissue29710 messages
2017-03-03 14:38:38ncoghlancreate