Skip to content

Conversation

rbri
Copy link
Collaborator

@rbri rbri commented Dec 27, 2023

use bit logic to avoid rounding errors (based on HtmlUnit#10)

rbri added a commit to HtmlUnit/htmlunit-rhino-fork that referenced this pull request Dec 30, 2023
rbri added a commit to HtmlUnit/htmlunit-rhino-fork that referenced this pull request Dec 30, 2023
Pull Request mozilla#1430: fix clz23 rounding errors
@gbrail
Copy link
Collaborator

gbrail commented Jan 15, 2024

Do you know if there's a test from test262 or anything that can verify this? For example, there is a "math-clz32.js" file in the V8 codebase, but it seems much different than this. I'm sure that this is right but I'd feel better if we had a reference.

@rbri
Copy link
Collaborator Author

rbri commented Jan 15, 2024

there is a "math-clz32.js" file in the V8 codebase, but it seems much different than this

yes, found the same while preparing this

@rbri
Copy link
Collaborator Author

rbri commented Jan 15, 2024

Do you know if there's a test from test262 or anything that can verify this?

Will have another look but i think i can't spend so much time on this and running all the samples in the browser proof that this is correct.

@rbri rbri changed the title fix clz23 rounding errors fix clz3s rounding errors Jan 15, 2024
@rbri rbri changed the title fix clz3s rounding errors fix clz32 rounding errors Jan 15, 2024
@rbri rbri mentioned this pull request Jan 15, 2024
@rbri
Copy link
Collaborator Author

rbri commented Jan 15, 2024

@gbrail looks like 262 has only tests for the border cases of Math functions (see PR #1438). Maybe we have to roll our own.

andreabergia pushed a commit to andreabergia/rhino that referenced this pull request Jan 15, 2024
@gbrail
Copy link
Collaborator

gbrail commented Jan 24, 2024

OK - I think we're in good shape here then. Thanks!

@gbrail gbrail merged commit 553681a into mozilla:master Jan 24, 2024
@rbri rbri deleted the clz32 branch April 15, 2024 16:02
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