-
Notifications
You must be signed in to change notification settings - Fork 97
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 decimal
support
#305
Comments
Fyi f64 supports an accuracy of ~= 1.0 x 10 ^ 16. Folks doing scientific work need around 1.0 x 10 ^ 40. |
Does the If not, I think the next step would be to review arbitrary precision libraries and figure out which to support. |
I tried BigRational but it just doesn't fit - I can't always specify my numbers as a fraction. Of the various arbitrary precision libraries out there the num-decimal crate provides some simple functionality that seems to work. Not sure of what limitations I'll face yet. |
A new decimal underlying storage type would be needed. See #287 for a similar effort to add complex numbers. I started a review of options. 3 year old summary: https://www.reddit.com/r/rust/comments/a7frqj/have_anyone_reviewed_any_of_the_decimal_crates/ Most popular options: https://crates.io/crates/bigdecimal Less popular options: https://crates.io/crates/fraction |
The problem with most of those (I'm not familiar with rug) is that the number type they provide does not support Copy. mamrhein/quantities.rs#1 (comment) Maybe this would be an easier / more ergonomic approach for uom as well. |
See #38 for implementing operators for references. |
I took a stab an implemented support for f256 using the quad library cargo test shows 67 warnings. Also, I'm unable to get even a simple example (examples/qd.rs) to work so it obviously doesn't work. Any thoughts on why qd.rs gets so many errors? |
A number of your changes are to the existing |
I need to add quantum mechanics into the mix. Planck's constant is 6.62607015 × 10−34 joule second.
I've looked at a few arbitrary precision libraries but I'm not sure which one to recommend. I like 'scientific' because it parses e notation. The bigdecimal crate also seems like it would work.
Thanks!
The text was updated successfully, but these errors were encountered: