Replies: 1 comment
-
This could be a nice addition for divisions by constant (and probably not too difficult to implement). Supporting general division is more tricky as divisions are not allowed in AIR constraints and so, we'd need to manipulate the expressions to get rid of divisions. For example:
Would need to be transformed into:
For complex expressions, this would require a robust formula processor. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Have been experimenting with AirScript, and it would be nice to add syntax for division
Desired behavior:
Has the same effect as:
For example in the Golidlocks field, 4^-1 is 13835058052060938241
so
enf a' = a + b / 4
should be equivalent to `enf a' = a + b * 13835058052060938241Precomputing the inverse is not only a bother but also obfuscates what operation is taking place (if more prime fields are supported by miden in the future such as M31, this could be problematic)
Would also be nice if we could do division of arbitrary values using Euler's Theorem to also make division in AirScript field agnostic (the division would be implemented by the field, abstracted away from the script it self)
Beta Was this translation helpful? Give feedback.
All reactions