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

Add test for multipleOf to ensure that implementation does not have an issue regarding scale #321

Open
seamusv opened this issue Dec 31, 2019 · 2 comments

Comments

@seamusv
Copy link

seamusv commented Dec 31, 2019

This is not a float/double related issue but is one regarding scale. Consider the following schema:

[
    {
        "description": "by deep scale",
        "schema": {"multipleOf": 0.25},
        "tests": [
            {
                "description": "8.75 is multiple of 0.25",
                "data": 8.75,
                "valid": true
            },
            {
                "description": "8.750000000001 is not multiple of 0.25",
                "data": 8.750000000001,
                "valid": false
            },
            {
                "description": "8.7500000000001 is not multiple of 0.25",
                "data": 8.7500000000001,
                "valid": false
            },
            {
                "description": "8.75000000000001 is not multiple of 0.25",
                "data": 8.75000000000001,
                "valid": false
            }
        ]
    }
]

This will ensure libraries with language support for a rich big decimal are not constrained by a low exponent check.

@ssilverman
Copy link
Member

For implementations that don't use a big decimal library, since the validation will fail ("valid" will turn out to be true), is there a way to ignore these tests?

@karenetheridge
Copy link
Member

This repository is just a bunch of data files. It's up to the individual implementation libraries to decide how to pull those files in and provide interfaces for running tests with them. So: check with your library to see what options are available, or submit a patch to enhance them :)

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

3 participants