diff options
author | Mark Pulford <mark@kyne.com.au> | 2012-03-03 10:48:09 +1030 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2012-03-04 20:06:37 +1030 |
commit | d5090bb8f19f4b0fd868a5f9af367ebbb67b7f5a (patch) | |
tree | b963cb47157c384ac8332602e3f0e1e694fc688f /dtoa.c | |
parent | 4bc5e917c8cd5fc2f6b217512ef530007529322f (diff) | |
download | lua-cjson-d5090bb8f19f4b0fd868a5f9af367ebbb67b7f5a.tar.gz lua-cjson-d5090bb8f19f4b0fd868a5f9af367ebbb67b7f5a.tar.bz2 lua-cjson-d5090bb8f19f4b0fd868a5f9af367ebbb67b7f5a.zip |
Use Javascript compat values for Infinity/NaN
Use Javascript compatible values for Infinity/NaN when encoding invalid
numbers.
Diffstat (limited to 'dtoa.c')
-rw-r--r-- | dtoa.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3748,9 +3748,9 @@ dtoa | |||
3748 | *decpt = 9999; | 3748 | *decpt = 9999; |
3749 | #ifdef IEEE_Arith | 3749 | #ifdef IEEE_Arith |
3750 | if (!word1(&u) && !(word0(&u) & 0xfffff)) | 3750 | if (!word1(&u) && !(word0(&u) & 0xfffff)) |
3751 | return nrv_alloc("inf", rve, 8); | 3751 | return nrv_alloc("Infinity", rve, 8); |
3752 | #endif | 3752 | #endif |
3753 | return nrv_alloc("nan", rve, 3); | 3753 | return nrv_alloc("NaN", rve, 3); |
3754 | } | 3754 | } |
3755 | #endif | 3755 | #endif |
3756 | #ifdef IBM | 3756 | #ifdef IBM |