-
Notifications
You must be signed in to change notification settings - Fork 440
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
Arbitrary precision rational arithmetic #2
Comments
I think at this point we're committed to double precision floating point. |
I got stuck with the limitation of |
@dynaxis Can you tell us more about your use case? We don't expect to change it (that's why it was closed), but it's not completely out of question. |
I'm using jsonnet to write JSON schemas. There, I need to write int range constraints comparable to |
Thanks. This seems like a very reasonable use case to me. In the short-term it is possible to implement a workaround: a custom Please note that the JSON specification allows the implementations to set limits on the precision, and recommends to avoid requiring more precision. A lot of JSON parsers have limitations there (Javascript, QT, Go with default settings...). So if you have control of the schema, perhaps it's better to avoid the need for large numbers there (e.g. by using a larger unit).
|
Thanks for the clarification. I'll think more about how I'll proceed taking your suggestion into acount. |
Add copyright notice to all files.
Using double precision floating point has its flaws, e.g. rounding errors. It makes sense to use arbitrary precision rational arithmetic in Jsonnet. We will have to find a library with a decent license that does not bloat the binary size too much, and then replace the current number representation.
The text was updated successfully, but these errors were encountered: