We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
is_le
is_nn
Functions are defined by
// Returns 1 if a >= 0 (or more precisely 0 <= a < RANGE_CHECK_BOUND). // Returns 0 otherwise. @known_ap_change func is_nn{range_check_ptr}(a) -> felt { %{ memory[ap] = 0 if 0 <= (ids.a % PRIME) < range_check_builtin.bound else 1 %} jmp out_of_range if [ap] != 0, ap++; [range_check_ptr] = a; ap += 20; let range_check_ptr = range_check_ptr + 1; return 1; out_of_range: %{ memory[ap] = 0 if 0 <= ((-ids.a - 1) % PRIME) < range_check_builtin.bound else 1 %} jmp need_felt_comparison if [ap] != 0, ap++; assert [range_check_ptr] = (-a) - 1; ap += 17; let range_check_ptr = range_check_ptr + 1; return 0; need_felt_comparison: assert_le_felt(RC_BOUND, a); return 0; } // Returns 1 if a <= b (or more precisely 0 <= b - a < RANGE_CHECK_BOUND). // Returns 0 otherwise. @known_ap_change func is_le{range_check_ptr}(a, b) -> felt { return is_nn(b - a); }
so callling directly is_nn(b - a) will save steps related to call and ret.
is_nn(b - a)
call
ret
The text was updated successfully, but these errors were encountered:
7bc70ad
obatirou
Successfully merging a pull request may close this issue.
Feature Request
Describe the Feature Request
Functions are defined by
so callling directly
is_nn(b - a)
will save steps related tocall
andret
.The text was updated successfully, but these errors were encountered: