[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bitwise XOR in Lua?
- From: Reuben Thomas <rrt@...>
- Date: Tue, 10 Sep 2002 13:35:12 +0100 (BST)
> You forgot the other "bunny" (whatever that means ;-):
>
> > not A = -A - 1 (Paul Hsieh wrote that)
>
> So, you have
>
> function bor (a,b) return -band(-a-1, -b-1)-1 end
Oops. I am being stupid yesterday. In particular, looking at the not
relationship (and indeed, knowing about it, of course!) I didn't think of
using it...duh...
--
http://www.mupsych.org/~rrt/
Quidquid latine dictum sit, altum viditur (Anon)