-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
more multipleOf and overflow tests, consolidated into optional/ #538
base: main
Are you sure you want to change the base?
Conversation
an implementation might use a different internal representation for 1.0 vs 1, therefore we test both
closes #534. |
e75ea94
to
daf1916
Compare
an implementation might use a different internal representation for 1.0 vs 1, therefore we test both
an overflow result is an error, which may not be treated as valid: false by an implementation
daf1916
to
42b8de3
Compare
I've tested these on drafts 2020-12, 2019-09 and 7; if someone else with support could check them on draft6 and draft4 that would be great. |
(Thanks!) I'm not sure how I feel about fully combining these yet personally. There are 2 distinct pieces here to me --
JSON only has numbers, but many languages (mine, Python one of them) uses floats for JSON numbers with decimals, and ints for ones without. Which means I support (by default) bignum but not infinite precision floats. I think that will not be uncommon -- so personally I'd probably lean towards splitting these tests into two separate optional files rather than just the one. Opinions welcome from others though. |
I'm happy either way. My main concern was putting both cases into optional, which is being addressed, so 👍 |
I'm not following your logic here. You would need bignums for high precision calculations, whether that's with integers or floats. e.g. for a calculation like 1e+308 / 0.123456789, both the arguments can be represented with native-architecture floats, but the calculation itself requires a high degree of precision in order to determine if the remainder is zero. |
I'm talking about tests like this: https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/538/files#diff-3070fe12dfc9ffeaf3ec0a633efce5b08f5cd07358f512904e3ffdb8f0b5103eR76-R95 That test mixes two unrelated concepts -- 18446744073709551600 passes if your implementation uses bigintegers. 18446744073709551600.0 requires the use of non-IEEE floats. An implementation may support one and not the other. And I was saying it's easier to deal with that if we have the two concepts separated. |
ok, I see. |
@karenetheridge any chance you're still up for splitting the above? |
More argument combinations for multipleOf, including floats that will be treated as integers, as these might be internally represented as floats rather than ints, and therefore may behave differently.
All tests that might overflow (i.e. with very large/small numbers or a high number of significant digits) are consolidated into optional/ as an error may not be treated the same as
valid: false
.