lua-users home
lua-l archive

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


Title: RE: Bitwise operations and binary number

Yes. Lua supports.  Go to search
around for bitwise operation.
I used it before.  But forget where
I found the library.


-----Original Message-----
From: nerurin@hotmail.com [mailto:nerurin@hotmail.com]
Sent: Tuesday, September 18, 2001 4:48 PM
To: Multiple recipients of list
Subject: Bitwise operations and binary number


Hi all,
I wonder if Lua supports binary number and bitwise operations or not.
I am play with an idea using a variable in binary to describe other
data structures.

for example

params_to_be_used{ a, b, c, d, e }
i_should_use = 10101   -- binary number
you_should_use = 10001 -- binary number

by having this,
I can simply using bitwise-AND, and find out what parammeter to be
used for different objects in order to avoid using too much memory
(using a array) or using too much computational time (using a lot of
if-elses).

I do aware there is alternative to archive this. But I am just
interested in whether binary number works in Lua or not.

Thanks!!

Nelson