lua-users home
lua-l archive

Re: [ANN] Lua 5.3.0 (work2) now available

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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

AltStyle によって変換されたページ (->オリジナル) /