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

multipleOf does not work for floats #985

Open
4 tasks
Willem-J-an opened this issue Aug 9, 2024 · 0 comments
Open
4 tasks

multipleOf does not work for floats #985

Willem-J-an opened this issue Aug 9, 2024 · 0 comments

Comments

@Willem-J-an
Copy link

Describe the bug

This code does not seem to accurately calculate if a number is a multipleOf in the case of float numbers. A value of 0.9 with a multipleOf is flagged, because 0.9 % 0.05 === 0.05 in javascript.

Expected Behavior

Value of 0.9 is not flagged.

Current Behavior

Value of 0.9 is flagged.

Steps to Reproduce

  1. Create schema with multipleOf 0.05
  2. Set value of 0.9
  3. The value is flagged as not being a multiple of 0.05

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)
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

1 participant