3 ms·
What is the one language? json serialized data can be consumed in many different languages which have very different numeric data types. The json spec even says
by testvox 8y ago
What is the one language? json serialized data can be consumed in many different languages which have very different numeric data types. The json spec even says
> JSON is agnostic about the semantics of numbers. In any programming language, there can be a variety of
number types of various capacities and complements, fixed or floating, binary or decimal. That can make
interchange between different programming languages difficult. JSON instead offers only the representation of
numbers that humans use: a sequence of digits. All programming languages know how to make sense of digit
sequences even if they disagree on internal representations. That is enough to allow interchange
and later more precisely defines a number in a way that does not restrict its maximum size.
> A number is a sequence of decimal digits with no superfluous leading zero. It may have a preceding minus
sign (U+002D). It may have a fractional part prefixed by a decimal point (U+002E). It may have an exponent,
prefixed by e (U+0065) or E (U+0045) and optionally + (U+002B) or – (U+002D). The digits are the code
points U+0030 through U+0039.
http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf http://www.ecma-international.org/publications/files/ECMA-ST...