Skip to content
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 number formats allowed #53

Open
qligier opened this issue Oct 20, 2017 · 0 comments
Open

Clarify number formats allowed #53

qligier opened this issue Oct 20, 2017 · 0 comments

Comments

@qligier
Copy link

qligier commented Oct 20, 2017

Hey,

I've read the spec but I'm still not sure what number formats are allowed in integer and floating point types. Based on the Ruby and JS implementations, I think that the only valid formats are:

  • (0|[1-9][0-9]*) for unsigned integers
  • -?(0|[1-9][0-9]*) for signed integers
  • -?(0|[1-9][0-9]*)(.[0-9]*)? for floating points

But the spec says:

Signed integer literals are identified by the "i" tag, with an associated JSON string literal value containing the string representation of a valid JSON integer literal

and

Floating points [...] should use the native JSON syntax

In RFC 7159, valid numbers are defined as number = [ minus ] int [ frac ] [ exp ], so -1e+1=-10 and 3E-2=0.03 are valid JSON numbers, whereas they are not valid in TJSON (?)

Can you please clarify this for me? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant