[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: checking for Not a Number?
- From: "Tom Bates" <tfbiv@...>
- Date: Thu, 21 Dec 2006 09:56:20 -0500
>> else if (ttisnumber(key) && nvalue(key) != nvalue(key))
>> luaG_runerror(L, "table index is NaN");
>It is not a bug. On IEEE 754 hardware, you can have "numbers" x that do not
>What compiler are you using?
Thanks for the clarification. I see I need to read that floating point
tutorial again. :-)
I am using a Microtec C/C++ cross compiler under Windows for a Motorola
68331 processor. I am currently working on porting Lua to a very limited
embedded platform that does not support floating point in hardware, so I
have built Lua using longs as Lua numbers. In this environment then, it
strikes me that the compiler is correct, and this code will not be
generated, which is fine.
BTW, when building Lua with longs under Visual Studio 6, there are a number
of warnings generated in the libraries (but not when building with doubles).
I am somewhat concerned that there may be places in the Lua environment that
assume numbers are floating point.
Please understand that I'm not trying to be critical of this effort. Lua
just blows me away with its concepts and capabilities. I hope to be able to
spend more time experimenting with it and really learning it.
But for now, I just need to get the port working. At the moment, the
interpreter does not build correct code from source, but the engine does
execute compiled code correctly.