Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
Re: invert or not ?
Steve Holden
3/1/2008 1:41:00 PM
Stef Mientki wrote:
> hello,
>
> from the manual I read that a bitwise inversion should be done by invert.
> But from some experiments I see that not works equally well.
> Is this coincidence ?
>
> (The disadvantage of invert is that I've to import operators)
>
Bitwise inversion is performed by the "~" operator. I think your
experimentation has been inadequate:
>>> for i in range(-10000, 10000):
.... if (not i) == (~i):
.... print i
....
-1
>>>
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC
http://www.hold...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: invert or not ?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password