[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Pretty printing serialization
- From: Albert-Jan Brouwer <acj.brouwer@...>
- Date: Wed, 17 Mar 2004 19:12:51 +0100
> I was pleasantly surprised just now to find that tonumber( "nan" )
> does the right thing.
Not with Visual C++ 6 or 7. It produces some funky formatting
(e.g. "-1.#QNAN") when tostringing a nan. And that is not reversible.
Don't know what, if any string, it does accept as a nan with tonumber().
Similarly so for infinite numbers.
> So, one could dump numbers by testing for the special cases.
Testing that has some issues as well. It should suffice to check if n==n
yields false to detect a nan, but Visual C++ 6 emits erroneous floating
point code that breaks that test.