miked
October 10th, 2004, 12:44 AM
Just an fyi that bit-wise operators are implemented in Girder's implementation of Lua. I.e., if you want 64 and 64 = 64 type logic, you can just use the "and" command. You have to use band(64,64).
Ron originally placed this on the old web site in an intro to Lua, but even then, the actual commands were not listed except in the demo file you could d/l. I couldn't find this info on the new web site, and nothing's on the forums. So this post is just sort of a place holder so that if anyone is searching for bitwise logical operators, you know how to do them!
band(a,b) = logical a and b
bnot(a) = logical not a
bor(a,b) = logical a or b
There are a few more, but I can't remember them at the moment.
Ron originally placed this on the old web site in an intro to Lua, but even then, the actual commands were not listed except in the demo file you could d/l. I couldn't find this info on the new web site, and nothing's on the forums. So this post is just sort of a place holder so that if anyone is searching for bitwise logical operators, you know how to do them!
band(a,b) = logical a and b
bnot(a) = logical not a
bor(a,b) = logical a or b
There are a few more, but I can't remember them at the moment.