delorie.com/archives/browse.cgi | search |
--=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9 =D0=A5=D0=B0=D1=80=D1=8C=D0=BA= =D0=BE=D0=B2=D1=81=D0=BA=D0=B8=D0=B9 <svetonomer-Re5JQEeQqe8AvxtiuMwx3w AT pub= lic.gmane.org> writes: > This is simple: > In [20]: ~0 > Out[20]: -1 For other readers who (like me) are being slow today, the ~ operator performs unary bitwise NOT. Apparently, integers in Python are explicitly two's complement. Rupert --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iJwEAQECAAYFAlLsAm0ACgkQRtd/pJbYVoZxBwP+JUXDf5LkmOb8ON7ydsoTScjm S67GdfeK0YDz6dotD1HzKt83xaHYQT5YoD1Im724aPKefCwhHY6p0epQSQQYlEMo rYVH3pOlMBLoFykJYE46r3jkkcRolIkxCt4JrC9TleQbq0A0m9OqUhfNg/WD1LA2 mh4wtgbV0oR22z/WMTU= =aPTk -----END PGP SIGNATURE----- --=-=-=--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |