lua-users home
lua-l archive

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


Title: lua_Number issues on linux/ppc platform

Hi Lua list,

  I am trying to install Lua on some new networking hardware running Linux on a ppc architechture.  Everything seems to be compiling and installing fine, BUT any numbers declared within Lua come out as garbage:

ie.
lua> print (5)
1.326655507102e-315

  The problem is only seen for numbers, strings, bools, tables, etc. all work as expected.  I have tried dropping the define for lua_Number down to float using luaconf.h, but I see the same results.  Anyway, the processor has a double-precision floating-point APU, doubles should absolutely be supported by the h/w.  This doesn't seem to be the overflow value either.  Here are some more examples.

lua> anumber = 123.456
lua> print ("type", type(anumber))
type    number
lua> print ("value", anumber)
value   2.1136742388458e-314
lua> print ("string", "123.456")
string  123.456
lua> print (string.format(" %d %f %x",anumber,anumber,anumber))
 2 0.000000 2
lua> print (anumber)
1.326655507102e-315

Any insights would be greatly appreciated.

Cheers,
Laura