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.
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 https://github.com/Zokrates/ZoKrates/pull/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