-
Notifications
You must be signed in to change notification settings - Fork 60
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
multipleOf not working as expected #123
Comments
sure, thx for trying |
It's not just a try. I test firstly if I didn't add any regression. And I can assure you there is no regression |
Thanks for improving :) |
Enhanced in v2.4.0 // set number scale (amount of decimals) (default is 14)
\Opis\JsonSchema\Helper::$numberScale = 8;
// disable bc-math
\Opis\JsonSchema\Helper::$useBCMath = false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you try to validate if the number 400.01 is a multiple of 0.01, you get an error that is not expected.
I have bcmath installed and thus Helper::isMultipleOf is going that way in my setup. Logging shows me that 400.01 is internally handled as 400.00999999999999 and 0.01 is 0.01000000000000, therefore the comparison is between 0 and 0.00999999999999.
I am unsure how to fix this, otherwise, I would have opened a pull request.
Thx upfront for any help :)
The text was updated successfully, but these errors were encountered: