lua-users home
lua-l archive

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


On 10/07/2013 9.09, Dirk Laurie wrote:
2013/7/6 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
Lua 5.3.0 (work1) is now available for testing at
         http://www.lua.org/work/lua-5.3.0-work1.tar.gz

The values of MAX_INTEGER and MIN_INTEGER from llimits.h need to
be accessible to Lua programs, maybe math.maxint, math.minint.


in another message Roberto stated that the width of both ints and floats
is available as:

debug.numbits'i'
debug.numbits'f'

Since 2's complement is assumed, you can compute them indirectly as

IBITS = debug.numbits'i'
MAX_INT = 2^(IBITS-1)-1
MIN_INT = -2^(IBITS-1)

Cheers,

-- Lorenzo

--
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments