-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Add SafeCast variants for signed integers #2240
Labels
good first issue
Low hanging fruit for new contributors to get involved!
Comments
nventuro
added
the
good first issue
Low hanging fruit for new contributors to get involved!
label
May 20, 2020
You're talking about a function functions like |
Precisely, yes. |
@nventuro @frangio I gave it a shot. Submitted PR #2243 Here is how one of the functions look for the example you mentioned above. Any chances or adjustments that need to be made please let me know. Thanks!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SafeCast
currently has support for downcasting uints and casting them to int256, but there's no safe way to downcast signed integers.This is slightly trickier because the two's complement integer representation has different ranges for positive and negative numbers, but should be easy to do anyway.
The text was updated successfully, but these errors were encountered: