-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Option for parsers to intepret precision of numbers #152
Comments
I'm for further discussing and fleshing out this thought! Seems like a sensible solution to the issue presented. |
I'm a bit confused as to what "having a precision of exactly one" actually means. Mathematical precision, at least as far as I can tell, refers to all the digits in a number, so having a precision of one would include only the numbers 0 through 9. |
I feel like this is best addressed by a |
@awwright I'm pretty sure that since we define JSON Schema over the data model and not over the JSON text, this doesn't work. Or at least not in any interoperable way, as the mapping of floating-point text to internal representations is not standardized. We've rejected numerous requests around distinctions that are only present in the JSON text for numeric formats, so I'm going to close this. @awwright if I missed something please re-open/re-file. |
This is fine. I haven't come across any use-cases in the... four... years this has been open. |
In some cases, parsers may want to expose the precision of a number in addition to its value -- especially for scientific cases where
1.2e4
is different than12000.000
- same value, very different precisions.In this case, we should allow parsers to define "integer" as "any number with a precision of exactly 1" instead of its current definition "any number with a zero fractional part".
This is a bit esoteric, but it is a totally valid use of JSON.
The text was updated successfully, but these errors were encountered: