You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
When dividing certain field elements the result is unexpected. Specifically, dividing 11 by 10 yields a large field element instead of the expected 1 or its equivalent representation in the field.
Code to Reproduce:
field x = 11;
field y = x / 10;
assert(y == 15321770010287492655572484021680092561983855080291224040588742930603065946933);
Expected Behavior:
The division of 11 by 10 should result in 1 or its equivalent representation in the field.
Actual Behavior:
The division results in the field element 15321770010287492655572484021680092561983855080291224040588742930603065946933.
Version:
ZoKrates 0.8.7
The text was updated successfully, but these errors were encountered:
This behavior is correct, division is defined as multiplication by the inverse modulo p. What you want is integer division, this is being added in #1349
Description:
When dividing certain field elements the result is unexpected. Specifically, dividing
11
by10
yields a large field element instead of the expected1
or its equivalent representation in the field.Code to Reproduce:
Expected Behavior:
The division of 11 by 10 should result in 1 or its equivalent representation in the field.
Actual Behavior:
The division results in the field element 15321770010287492655572484021680092561983855080291224040588742930603065946933.
Version:
ZoKrates 0.8.7
The text was updated successfully, but these errors were encountered: