-
Notifications
You must be signed in to change notification settings - Fork 160
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: Implement hint on uint256_mul_div_mod
#957
Conversation
Codecov Report
@@ Coverage Diff @@
## main #957 +/- ##
========================================
Coverage 97.74% 97.75%
========================================
Files 74 74
Lines 30392 30538 +146
========================================
+ Hits 29708 29851 +143
- Misses 684 687 +3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
uint256_mul_div_mod
uint256_mul_div_mod
uint256_mul_div_mod
let a_addr = get_relocatable_from_var_name("a", vm, ids_data, ap_tracking)?; | ||
let b_addr = get_relocatable_from_var_name("b", vm, ids_data, ap_tracking)?; | ||
let div_addr = get_relocatable_from_var_name("div", vm, ids_data, ap_tracking)?; | ||
let quotient_low_addr = | ||
get_relocatable_from_var_name("quotient_low", vm, ids_data, ap_tracking)?; | ||
let quotient_high_addr = | ||
get_relocatable_from_var_name("quotient_high", vm, ids_data, ap_tracking)?; | ||
let remainder_addr = get_relocatable_from_var_name("remainder", vm, ids_data, ap_tracking)?; | ||
|
||
let a_low = vm.get_integer(a_addr)?; | ||
let a_high = vm.get_integer((a_addr + 1_usize)?)?; | ||
let b_low = vm.get_integer(b_addr)?; | ||
let b_high = vm.get_integer((b_addr + 1_usize)?)?; | ||
let div_low = vm.get_integer(div_addr)?; | ||
let div_high = vm.get_integer((div_addr + 1_usize)?)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need a getter for this kind of structured data eventually, if possible generic so they're still refs.
* Add normalize address hints * Revert "Add normalize address hints" This reverts commit 86077f2. * Add uint256_mul_div_mod hint * Add hint to match * Expand uint256 integration test * use u128::MAX * Fix value * Manage quotient & remainder as BigUint * Add test for hint * Add test for hint * Add misc test * Add changelog entry * fmt * fmt
Implements hint: https://github.com/starkware-libs/cairo-lang/blob/55a26f4228dcff9c51d3d6bfd5e6638bafe63101/src/starkware/cairo/common/uint256.cairo#L242
unit tests
integration tests