Skip to content

BigInt arithmetic op_add is buggy #860

@CAIMEOX

Description

@CAIMEOX
-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
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions