Skip to content

isMultipleOf() false negatives? #172

Open
@pateketrueke

Description

@pateketrueke

I'm validating this value:

{
  "num": 0.47000000000000003
}

...against the schema:

{
  "type": "object",
  "properties": {
    "num": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "multipleOf": 0.01
    }
  },
  "required": [
    "num"
  ]
}

...but is failing with 'has a remainder' which I think is bit wrong?

Also I tested the same sample/schema with: tv4, z-schema and jayschema and it there's no problem.

I noticed that 0.47 passes isMultipleOf as expected but then the other validators fails...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions