It's the smallest I could find.
Asked
Active
Viewed 1,201 times
1
-
Please also refer to http://stackoverflow.com/questions/1423081/json-left-out-infinity-and-nan-json-status-in-ecmascript. – ziesemer Sep 08 '12 at 21:17
-
3the unicode symbol "∞"? http://unicodinator.com/#221E ok, I know you want a Number. – jwl Sep 08 '12 at 21:18
1 Answers
-1
The JSON RFC ( https://www.rfc-editor.org/rfc/rfc4627 ) states that NaN, Positive Infinity and Negative Infinity cannot be represented in JSON:
Numeric values that cannot be represented as sequences of digits (such as Infinity and NaN) are not permitted.
I don't know where you're getting 1*10^309 from, because Javascript's maximum exact integer value is 2^53.
When you say "concise" do you actually mean "succinct"?
-
"Javascript's maximum numeric value is 2^53" - I don't think that's correct. IIUC, Javascript uses IEEE 754 binary64 format to store all numbers (whether integer or float). 2^53 is significant in that all integer values not exceeding 2^53 in absolute value can be represented exactly, but a JS Number can represent values up to 2^1024 - 2^971, which is around 1.8e308. – Mark Dickinson Sep 08 '12 at 21:57
-
Yes, you're right. 2^53 is the maximum value for integer values (based on the number of significant bits available). I forgot about floating value limits (despite this actually being a thread about floats). – Dai Sep 16 '12 at 22:16
-
-