Given a schema like the following:
"salary": {
"type": "number",
"multipleOf": 0.01
}
and the value 10000.51.
The validation returns a false validation error. This appears to be due to floating point precision errors of the modulus operator used. This error may appear for any number < 1 and > 0.
I'm happy to create a fix and pull request for this. Due to the nature of the error it may require adding a dependency like http://jsfromhell.com/classes/bignumber, https://github.com/josdejong/mathjs or something similar as floating point calculations tend to quite complex problems to solve.
Let me know
Thanks
Glenn
Given a schema like the following:
"salary": {
"type": "number",
"multipleOf": 0.01
}
and the value 10000.51.
The validation returns a false validation error. This appears to be due to floating point precision errors of the modulus operator used. This error may appear for any number < 1 and > 0.
I'm happy to create a fix and pull request for this. Due to the nature of the error it may require adding a dependency like http://jsfromhell.com/classes/bignumber, https://github.com/josdejong/mathjs or something similar as floating point calculations tend to quite complex problems to solve.
Let me know
Thanks
Glenn