close
Skip to content

fix: More proper Math.round - #1857

Merged
MaxGraey merged 1 commit into
AssemblyScript:masterfrom
MaxGraey:fix-math-round
May 19, 2021
Merged

fix: More proper Math.round#1857
MaxGraey merged 1 commit into
AssemblyScript:masterfrom
MaxGraey:fix-math-round

Conversation

@MaxGraey

@MaxGraey MaxGraey commented May 19, 2021

Copy link
Copy Markdown
Member

Previous implementation was incorrect for maximum mantissa values.

Edge cases current:

Math.round(+9007199254740991) -> +9007199254740992
Math.round(-9007199254740991) -> -9007199254740990

Edge cases fixed:

Math.round(+9007199254740991) -> +9007199254740991
Math.round(-9007199254740991) -> -9007199254740991

Fix #1856

  • I've read the contributing guidelines

@MaxGraey
MaxGraey merged commit 5e19467 into AssemblyScript:master May 19, 2021
@MaxGraey
MaxGraey deleted the fix-math-round branch May 19, 2021 20:42
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.

a small bug in Math.round with some values between 2**52 and 2**53

1 participant