Skip to content

Unexpected Result When Dividing Field Elements  #1337

@silvesterdrago

Description

@silvesterdrago

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions