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

BigInt arithmetic op_add is buggy #860

Closed
CAIMEOX opened this issue Aug 16, 2024 · 0 comments · Fixed by #864
Closed

BigInt arithmetic op_add is buggy #860

CAIMEOX opened this issue Aug 16, 2024 · 0 comments · Fixed by #864
Assignees

Comments

@CAIMEOX
Copy link
Collaborator

CAIMEOX commented Aug 16, 2024

-1N + 1N == 0 // false
println(-1N + 1N) // panics

In fact, -1N + 1N produces the following result:

{
 limbs: [],
 sign: Positive,
 len: 0
}

but we expected 0N:

{
 limbs: [0],
 sign: Positive,
 len: 1
}
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 a pull request may close this issue.

3 participants