lua-users home
lua-l archive

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

Roberto Ierusalimschy wrote:
Roberto said they (inner Lua dev group) weren't happy with any known implementation of bitwise operators, it would be helpful to know what they are not pleased with so we may propose alternate solutions/implementations.

My dream was bitwise operators that make sense for floating numbers,
like shifts and negation do. But I gave up.

-- Roberto

Oh. Well. Yah, you won't be getting very far with bitwise ops on float, I suggest that floats be cast to ints (or whatever) and then the ops performed on them. It's common knowledge you won't be getting bitwise ops on floats natively/naturally unless you add some (a lot) of magic powder to the mix with a slice of lemon. But even there, I don't thing the idea of bitwise ops can ever EVER apply to floats, since their internal representation does not match that of a 'simpler' number like char/short/int/etc... That said, I had in mind to use bitwise ops on whole numbers anyways...

Have we considered adding fixed point precision numbers?