Skip to content

fix: Use proper portable copysign polyfill #2490

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

Merged
merged 6 commits into from
Sep 25, 2022

Conversation

MaxGraey
Copy link
Member

@MaxGraey MaxGraey commented Sep 1, 2022

Previous one can't properly handle such edge cases:

copysign(1.0, +0.0)   ->  +0.0
copysign(1.0, -0.0)   ->  -0.0
copysign(1.0, +NaN)   ->  NaN
copysign(1.0, -NaN)   ->  NaN

Now, these cases don't change destination x argument. Only its sign:

copysign(1.0, +0.0)   ->  +1
copysign(1.0, -0.0)   ->  -1
copysign(1.0, +NaN)   ->  +1
copysign(1.0, -NaN)   ->  -1
  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@MaxGraey MaxGraey merged commit 5e17892 into AssemblyScript:main Sep 25, 2022
@MaxGraey MaxGraey deleted the fix-portable-copysign branch September 25, 2022 17:40
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.

1 participant