lua-users home
lua-l archive

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


>Hate to ask what linux are you running! Mine (intel) accepts and 
>handles NaN properly, infact all linux installs I've had have handled 
>NaN properly, the Solaris machies here at work all accept and 
>handle "NaN" properly. If your machine does not handle NaN suggest 
>you better get a new one! Gosh how can you do any serious maths work 
>without everyones friends +INF, -INF and NAN popping up in your face!!

Mine is a Intel PC running Linux RH 5.2. I think this is a feature of glibc.
My RH 5.2 runs gcc 2.7.2.3 and there's no support for NAN in strtod.
I've compiled Lua in RH 6.2 that runs gcc 2.95.2 and it supports NAN and so
does Lua.

Anyway, I don't think NAN, INF and other IEEE stuff are a requirement of
ANSI C strtod. So, there's nothing we can do in tonumber in the general case
(and nothing to do in the special cases when strtod does handle NAN!).
--lhf