why subtract one in integer_chip
JohnWick2ETH opened this issue · 2 comments
JohnWick2ETH commented
why subtract one to compute v1 in the integer_chip.add_constraints_for_mul_equation_on_limb0()
?
AFAIK, v1*2^2b = u1 + v0
.
lanbones commented
To avoid minus overflow when computing u0, we borrowed one from v1.
Think about
limbs[1].value < rem.limbs_le[1].value || (limbs[1].value == rem.limbs_le[1].value && limbs[0].value < rem.limbs_le[0].value)
see
JohnWick2ETH commented
why would it happen that u0
is negative?