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

fix: reproduce and fix motoko-base/issues/653 #4712

Merged
merged 5 commits into from
Sep 26, 2024
Merged

fix: reproduce and fix motoko-base/issues/653 #4712

merged 5 commits into from
Sep 26, 2024

Conversation

ggreif
Copy link
Contributor

@ggreif ggreif commented Sep 26, 2024

Cf. fixes dfinity/motoko-base#653

It appears that a <> Big_int.zero_big_int blows up when
a is zero. Weird. Eliminating the comparison doesn't hurt
correctness, and is probably more efficient too, as negating
zero should be cheap!

@timohanke feel free to review too!

@ggreif ggreif self-assigned this Sep 26, 2024
@ggreif ggreif added the Bug Something isn't working label Sep 26, 2024
Copy link

github-actions bot commented Sep 26, 2024

Comparing from 8d6841e to 5f9f320:
The produced WebAssembly code seems to be completely unchanged.

it appears that `a <> Big_int.zero_big_int` blows up when
`a` is zero. Weird. Eliminating the comparison doesn't hurt
correctness, and is probably more efficient too, as negating
zero should be cheap!
@ggreif ggreif changed the title chore: reproduce motoko-base/issues/653 fix: reproduce and fix motoko-base/issues/653 Sep 26, 2024
Copy link
Contributor

@luc-blaeser luc-blaeser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Looks good to me. I tested it also with -0.0 (using copySign).

@ggreif ggreif added the automerge-squash When ready, merge (using squash) label Sep 26, 2024
@mergify mergify bot merged commit 8557a30 into master Sep 26, 2024
10 checks passed
@mergify mergify bot deleted the gabor/base653 branch September 26, 2024 16:15
@mergify mergify bot removed the automerge-squash When ready, merge (using squash) label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Float.toInt buggy for values between -1 and 0
2 participants