On Thu, Feb 12, 2009 at 4:03 PM, David Cantrell <da...@cantrell.org.uk> wrote:
> On Thu, Feb 12, 2009 at 03:30:22PM +0000, James Laver wrote:
>
>> Although by rights it should be -1 on a twos complement machine.
>> (For those who remember ones complement based numbers, or even know
>> they existed).
>
> You're confusing logical not with bit-wise not:
>
> $ perl -e 'print "".(!0)."\n"'
> 1
> $ perl -e 'print "".(~0)."\n"'
> 4294967295                        <-- 32-bit -1
> $ perl64 -e 'print "".(~0)."\n"'
> 18446744073709551615              <-- 64-bit -1
>

Okay, I may be stretching things a little far for comparatively crap
humour, but I am aware of the difference.

In any case, it wasn't funny, I'll drop it.

--James

Reply via email to