lua-users home
lua-l archive

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


On Thu, Nov 7, 2013 at 5:51 PM, Methos <methos.oldest@gmail.com> wrote:
> Hi,
>
> I am writing some Lua code for OpenWRT platform that uses Lua
> BitOp(http://bitop.luajit.org/).
> I am having problem in getting expected result.
>
> 1. Initial problem:
>
> On OpenWRT, Lua is applied with LNUM patch that changes the number
> representation internally. Initially the compilation of Lua BitOp was
> failing with an error:
>
> "Unknown number type, check LUA_NUMBER_* in luaconf.h"
>
> After some investigation with luaconf.h on native Linux platform and OpenWRT
> platform, I came to know about LNUM patch and how it adds a different kind
> of support for double/ints for OpenWRT
> (http://stackoverflow.com/questions/945731/what-is-the-maximum-value-of-a-number-in-lua#answer-947763).

Hmm, LNUM basically (a bit like to Lua 5.3 experimental release)
transparently switches number types between different representations
when they overflow, and clearly it is converting at points where bitop
does not expect it. It might be fixable but you will have to go into
the details of how LNUM works. I would be more inclined to install a
more standard Lua version, eg 5.2 with an int type if you need
performance...

Justin