!0

David Cantrell david at cantrell.org.uk
Thu Feb 12 16:03:58 GMT 2009


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

-- 
David Cantrell | top google result for "topless karaoke murders"

Please stop rolling your Jargon Dice and explain the problem
you are having to me in plain English, using small words.
  -- John Hardin, in the Monastery


More information about the london.pm mailing list