[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.3.0 (work2) now available
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sun, 23 Mar 2014 19:46:09 +0200
2014-03-23 16:58 GMT+02:00 Thijs Schreijer <thijs@thijsschreijer.nl>:
> I find it confusing that the operator '~' is used for both 'xor' and 'unary not'.
Think of it this way. Prefix `-` is related to infix `-` by the identity
-x == 0-x
Prefix `~`, as your examples so clearly demonstrate, is related to infix `~` by
~x == (-1)~x
since -1 == 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF