-
Notifications
You must be signed in to change notification settings - Fork 11
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
Convert BigNum to/from integer types #80
Comments
Hi Oleh, I'm currently writing a |
Why a from_field method instead of From::from trait impl? |
that's what I meant. I'm writing an impl for |
Good. I specifically need U128 tbh. But it should be convertible using U128::to_integer().into::(). Any chance you can get the conversion from BigNum to Field implemented as well? |
#87 |
Problem
Need to convert BigNum to/from U128 or u8, u16, u32, u64.
Happy Case
Add
BigNum::from(x: U128)
andU128::from(x: BigNum)
viaFrom
trait. An error should be thrown if the conversion is invalid (number is too big/too small).Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
Blocker
Blocker Context
No response
Would you like to submit a PR for this Issue?
Maybe
Support Needs
IDK how to convert, so if someone can explain in words/pseudocode, i can submit a PR
The text was updated successfully, but these errors were encountered: