moonbitlang/core

BigInt arithmetic `op_add` is buggy

CAIMEOX opened this issue · 0 comments

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