-
Notifications
You must be signed in to change notification settings - Fork 172
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
Fix ModBuiltin not able to handle n=0 #1935
base: main
Are you sure you want to change the base?
Conversation
Hi there! |
Hi @ClementWalter! Thanks for the contribution. Could you add a test with the failing case that you mentioned? |
I don’t see where to actually add tests. It seems like the function is currently not tested at all I also see that in the places where you actually test the mod builtins, you left relevant TODOs
Which would actually have shown the issue. Should I update this? |
The function
A quick way of testing this is by adding a test case in
I tried uncommenting those imports on
I tried leaving it like this:
And the related tests passed without errors. Given this, I think it's not necessary to uncomment those imports for now but I will keep you updated when it would be necessary. |
Hi @ClementWalter! I'm not sure that the fix in the right place.
Would this change also fix the issue? |
@JulianGCalderon it will probably work as well, as you prefer. I however don't manage to do neither |
@ClementWalter could you share the error message you get when running |
TITLE
Description
Fixes a bug where
fill_memory
would return an error if the number of elements to fill is 0.See also the python implementation of
fill_memory
incairo-lang
: https://github.com/starkware-libs/cairo-lang/blob/8276ac35830148a397e1143389f23253c8b80e93/src/starkware/cairo/lang/builtins/modulo/mod_builtin_runner.py#L349-L352Resolves #1934
Checklist