-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify meaning of hexadecimal values #6
Comments
Thanks for the question. It means 18437397125074382557. Do you have any recommendations on how to reword the spec to be clearer? |
I do not have a good rewording, since explaining it exactly would require definition of endianness and maybe a formula for converting the values between formats. Maybe I would use example section with comments to tell what the hex value should, e.g.
|
I was going to say that hex literals should be interpreted as they are in the ES5 spec, but the ES5 spec isn't much help. Here's a snippet from what it has to say about hex literals.
Technically it defines how hex literals should be interpreted, but it's not in clear language. |
ParseInt tells how the hex value should be converted to int I think the step 13. is what I am looking for, but wording in that is too "specsy". |
Aren't platform concerns outside the scope of the specification? I don't think JSON stipulates any details about platform constraints? Platform constraints are going to vary among platforms (duh 🙄) so I don't think it makes sense for a standard that describes a transport encoding to stipulate any details about how numbers should be stored or represented outside of the file, e.g. in memory, in a database, etc.? AFAIK, JSON only defines the In that sense, the JSON standard has the same "problem", if somebody wants to store, say, |
I don't think the representation or storage of numbers outside the JSON5 document is in question here. What's being proposed is that we specify what a hexadecimal number means. The JSON specification explicitly states that numbers are base 10. So all implementations can agree that As far as hexadecimal values, I think that specifying that they are base 16 is enough. There is no ambiguity as to how a base 16 value converts to base 10, but that's not the only use case for hexadecimal values. It's a missed opportunity in parsers, including the reference parser, to convert hex values to decimal without giving the ability to retrieve the original representation. (I.e. So I don't think it matters what |
So my current problem is definition of hexadecimal number system. The specs say:
So if I have the string value
does that mean it stores
15991963345402650367
-2454780728306901249
-3.011212125377999e+144
18437397125074382557
-9346948635169059
-8.649422920012688e+307
or maybe something else?
The text was updated successfully, but these errors were encountered: