-
Notifications
You must be signed in to change notification settings - Fork 208
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Right now, modulo builtin constraints are not always fulfilled.
- Given a sub mod gate (for example:
x3 = x2 - x1), then it must always be true thatx3 + x1 - x2 = 0 or p.
Take, for example, x2 = p + 1 and x1 = 1. Our current implementation will calculate x3 = 0 as a result of the operation (x2 - x1) % p. The expected output is p, as it's the minimum value that meets the constraint (p + 1 - (p + 1) = 0). (the other possible value is 2p.
See starkware-libs/cairo-lang#196 and cairo-lang implementation as reference.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working