lua-users home
lua-l archive

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


>From jeske@home.chat.net Mon May 11 23:26:47 1998
>
>Okay, I know this has come up as a discussion before, and the general
>concensus was that integers were not necessary. However, I'm starting to
>use Lua in a project where not having integers is going to make my life
>difficult. I think lua is the right tool for the job, but it'll be much
>nicer if Lua has integers.

if you do not need real numbers, then you can #defeine real to be long
and everything should work, in Lua 3.1.

>I think it's mostly a problem with format() loosing precision. However, I
>really need to be able to deal with bit math and also I need to be able to
>enter hex constants and such into lua scripts.
>
>I may end up using a userdata type for the time being. However, I would
>much prefer not to have to do something like:
>
>number = integer("0x44544a"); 
>
>within all my Lua code. 

In 3.1, you can also write X"0x44544a". this is sugar for X("0x44544a").
--lhf