Skip to content

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

Open
@seamusv

Description

@seamusv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions