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

Fixed floating point problems in isStepDivisible #149

Merged
merged 2 commits into from
Aug 10, 2021

Conversation

dgershun
Copy link
Contributor

for this issue : #110

Still had problems with division in isStepDivisible function.
Example:

let max=1;
let min=0.4;
let step=0.1;
(max - min) / step

returns 5.999999999999999, so isStepDivisible is false, which is not correct. My proposal resolves this issue using toFixed method with some precision

Still had problems with division in isStepDivisible function.
Example:
```
let max=1;
let min=0.4;
let step=0.1;
(max - min) / step
```

returns `5.999999999999999`, so isStepDivisible is false, which is not correct. My proposal resolves this issue using toFixed method with some precision
@tajo tajo merged commit d0e8be7 into tajo:master Aug 10, 2021
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

Successfully merging this pull request may close these issues.

2 participants