Is there is a more concise representation of Infinity in JSON than 1e309?

半世苍凉 提交于 2019-12-24 07:18:49

问题


It's the smallest I could find.


回答1:


The JSON RFC ( http://tools.ietf.org/html/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"?



来源:https://stackoverflow.com/questions/12334559/is-there-is-a-more-concise-representation-of-infinity-in-json-than-1e309

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!