-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: better IntegerDivision
implementation
#18
base: main
Are you sure you want to change the base?
feat: better IntegerDivision
implementation
#18
Conversation
signal output remainder; | ||
|
||
assert(divisor != 0); | ||
quotient <-- dividend \ divisor; |
Check warning
Code scanning / Circomspect
Using the signal assignment operator <-- does not constrain the assigned signal. Warning
|
||
assert(divisor != 0); | ||
quotient <-- dividend \ divisor; | ||
remainder <-- dividend % divisor; |
Check warning
Code scanning / Circomspect
Using the signal assignment operator <-- does not constrain the assigned signal. Warning
c <== IntegerDivision(n)(a * (10 ** W), b); | ||
// Use tuple assignment to get both quotient and remainder | ||
signal quotient; | ||
(quotient, _) <== IntegerDivision()(a * (10 ** W), b); |
Check warning
Code scanning / Circomspect
The output signal remainder defined by the template IntegerDivision is not constrained in DivisionFromFloat. Warning
// Perform integer division after multiplication to adjust the result back to W decimal digits. | ||
c <== IntegerDivision(n)(a * b, 10 ** W); | ||
signal quotient; | ||
(quotient, _) <== IntegerDivision()(a * b, 10 ** W); |
Check warning
Code scanning / Circomspect
The output signal remainder defined by the template IntegerDivision is not constrained in MultiplicationFromFloat. Warning
Description
This PR introduces a better
IntegerDivison
templateThere are none breaking changes.
Related Issue(s)
Closes #14
Checklist
yarn format
andyarn compile
without getting any errorsIt generates new warnings: