Skip to content
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

BUG: override default FromPrimitive implementation for u128 and i128 #101

Merged
merged 2 commits into from Jun 4, 2023

Conversation

qdrs
Copy link
Contributor

@qdrs qdrs commented May 30, 2023

The default FromPrimitive implementation for BigDecimal::from_u128 and BigDecimal::from_i128 goes through u64 and i64 respectively, rendering the default implementation useless as any number greater than 64 bits won't be parseable into a 128 bit number. The default implementation currently used can be found here:

https://github.com/rust-num/num-traits/blob/4ac94b4136ea06d0bd0e1b8abe30c55a45acffdf/src/cast.rs#L476

I have overridden the default implementation so that this function actually works as intended.

@akubera akubera merged commit eaa77a0 into akubera:trunk Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants