On 29-Dec-06, at 6:10 PM, Joe Smith wrote:
nvalue(key) is actually a macro which access the numeric value from a union in the struct which key points to. So it's completely safe. Even if the value were widened in one of the expansions and not in the other, the comparison would still work as expected since widening cannot alter the value.I'm still not sure that this code is correct:If nvalue(key) was stored in a varible, which was compaired to itself, then I would agree that itelse if (ttisnumber(key) && nvalue(key) != nvalue(key)) luaG_runerror(L, "table index is NaN");would be required to do the right thing.