On 10/28/2010 10:01 AM, Xavier Ho wrote:
On 28 October 2010 23:52, Dave Angel<da...@ieee.org> wrote:
The ~- trick only works on two's complement numbers. I've worked on
machines in the past that used one's complement, and this wouldn't work
there.
DaveA
I imagine this wouldn't work on floating point numbers either.
Cheers,
Xav
From the help:
"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"
Inverting the bits of a floating point number wouldn't make much sense,
so fortunately it gives an error.
DaveA
--
http://mail.python.org/mailman/listinfo/python-list