Comments (6)
This is definitely something I've been watching and something I'd like to implement. Of the two, I wanted to really see how u128
performed and how it could improve division performance. Blocks such as this can be removed which I think could come with some big improvements.
I'm going to keep this open as I do want to iterate on this feature.
from rust-decimal.
This is still on the roadmap however due to significant restructuring will be a V2 feature instead. First stage is to stabalize towards 1.0.
from rust-decimal.
I've started some experimentation of this in the evolution
branch. There is much more that needs to be done here, but am open to suggestions. I'm quite curious regarding the crypto scenario and the precision that may be needed here. What sort of precision is typically expected here? (I'm unfamiliar with the implementation of this domain).
from rust-decimal.
For those that are following this issue; I'm interested if anyone has found performance improvements on their machine? In my investigations, i128
and u128
have been slower.
I also think there are perhaps three motivations here based on the comments:
- Increase storage capacity by using unused bytes
- Increase storage capacity greater than 128 bits
- Improve performance by utilizing native
u128
/i128
types
I've been focusing on number 3 with this (unsuccessfully so far on my hardware), however I suspect others may be looking for either 1 (similar to the C implementation) or perhaps number 2. I'd be interested in any input here to see what people are thinking about.
from rust-decimal.
@xilec I wish to refer to your i128 based implementation,thanks a lot ,Can you share a github gist link,thanks a lot ❗️
from rust-decimal.
It might be worth investigating using NonZeroU128
, to take the advantage of the null-value optimization, if there are any bits known to be non-zero.
from rust-decimal.
Related Issues (20)
- bug: `to_str_internal` fails with large value
- cosine causes stack overflow for this value HOT 1
- [Documentation] Tolerance handling in `checked_exp_with_tolerance` method HOT 2
- Disabled optional weak dependencies like "borsh" are pulled in with default-features HOT 2
- Feature request: `Decimal::is_integer()` HOT 3
- Update borsh crate due to a security vulnerability issue. HOT 4
- Can't deserialize with `float_option` when null in an internally tagged enum HOT 3
- `trunc_with_scale` issue HOT 4
- `serde-arbitrary-precision` without `serde-float` HOT 7
- `is_integer` has BUG HOT 1
- How to serialize Decimal and still keep the results in order (bitwise comparison) HOT 3
- Serialization V2 - brainstorming HOT 1
- feature request: JSON schema support via https://github.com/GREsau/schemars HOT 1
- Feature Request: Support wasm_bindgen for Decimal
- rlp (de)serialization? HOT 2
- Rust Decimal: Request for additional repository Owner/Collaborator(s) HOT 1
- Rescaling a value with significant scale 28 to scale 29 creates a value with scale 29 and overflows on subtraction HOT 1
- Support for mongo HOT 2
- To f64 losing accuracy for `100000.000000000000000000` HOT 1
- Scaling string representation differs from dividing by 10^x HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-decimal.