-
Notifications
You must be signed in to change notification settings - Fork 386
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
Bug in roundHandlesBoundaryConditions #432
Comments
In any case, the code currently replaces Math.round if Math.round(-0.4999...) isn't equal to 1. |
Can you provide a test case that you think should pass, that fails with our current code? Indeed I see Per https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L2071-L2072, I checked Safari 8, IE 11, and Opera 12, and got the same results.
@Yaffle, could you confirm that this is the right fix here? |
The polyfill replaces the native Math.round even if it is good.
It seems it was added by mistake. |
There was definitely a reason that I added the second condition, but if we can't reproduce what it was, then it's probably worth removing it. I'll do so when I have time to rerun tests on all the browsers and versions. |
@ljharb which tests do you need to rerun? Can I help you? |
In roundHandlesBoundaryConditions, I think the the
-0.5
should be positive in the second half (i.e.Math.round(-0.5 + (Number.EPSILON / 3.99)) === 1
).The text was updated successfully, but these errors were encountered: