Comments (2)
Further info:
---- decimal::test::test_max_compares stdout ----
thread 'decimal::test::test_max_compares' panicked at 'Decimal Overflow', src/decimal.rs:392:12
stack backtrace:
0: 0x10ac84c73 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::h77f333888e74def2
1: 0x10ac86a0a - std::panicking::default_hook::{{closure}}::he7cfcf7125dff55f
2: 0x10ac86508 - std::panicking::default_hook::h99f8c39c0e377395
3: 0x10ac88cd2 - std::panicking::rust_panic_with_hook::he7ea255c9426c7e7
4: 0x10abf19c6 - std::panicking::begin_panic::h59a0a52935dd2803
5: 0x10ac111ac - rust_decimal::decimal::Decimal::from_bytes_le::he19537cb02f624cc
6: 0x10ac107b4 - rust_decimal::decimal::Decimal::rescale::h076f32ccc7ca84f5
7: 0x10ac152bc - <rust_decimal::decimal::Decimal as core::cmp::Ord>::cmp::ha17542b8d9316ade
8: 0x10ac1521c - <rust_decimal::decimal::Decimal as core::cmp::PartialOrd>::partial_cmp::h3b55f911c92beda5
9: 0x10ac0162c - core::cmp::PartialOrd::lt::h14522f0ce10a6b85
10: 0x10ac16871 - rust_decimal::decimal::test::test_max_compares::h80205b5e3f8fcb85
11: 0x10ac53ab1 - <F as test::FnBox<T>>::call_box::h7d01a5d4825fcd4d
12: 0x10ac89e2c - __rust_maybe_catch_panic
13: 0x10ac44a58 - std::sys_common::backtrace::__rust_begin_short_backtrace::h00ee79cb1cc21f6e
14: 0x10ac45827 - std::panicking::try::do_call::ha9fae25707519121
15: 0x10ac89e2c - __rust_maybe_catch_panic
16: 0x10ac4d733 - <F as alloc::boxed::FnBox<A>>::call_box::hc43bdbb6dd582cb8
17: 0x10ac85fab - std::sys::imp::thread::Thread::new::thread_start::h48c72bb09587cbc3
18: 0x7fff774556c0 - _pthread_body
19: 0x7fff7745556c - _pthread_start
---- decimal::test::test_min_compares stdout ----
thread 'decimal::test::test_min_compares' panicked at 'Decimal Overflow', src/decimal.rs:392:12
stack backtrace:
0: 0x10ac84c73 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::h77f333888e74def2
1: 0x10ac86a0a - std::panicking::default_hook::{{closure}}::he7cfcf7125dff55f
2: 0x10ac86508 - std::panicking::default_hook::h99f8c39c0e377395
3: 0x10ac88cd2 - std::panicking::rust_panic_with_hook::he7ea255c9426c7e7
4: 0x10abf19c6 - std::panicking::begin_panic::h59a0a52935dd2803
5: 0x10ac111ac - rust_decimal::decimal::Decimal::from_bytes_le::he19537cb02f624cc
6: 0x10ac107b4 - rust_decimal::decimal::Decimal::rescale::h076f32ccc7ca84f5
7: 0x10ac152bc - <rust_decimal::decimal::Decimal as core::cmp::Ord>::cmp::ha17542b8d9316ade
8: 0x10ac1521c - <rust_decimal::decimal::Decimal as core::cmp::PartialOrd>::partial_cmp::h3b55f911c92beda5
9: 0x10ac0154c - core::cmp::PartialOrd::gt::h0536292073878af5
10: 0x10ac16961 - rust_decimal::decimal::test::test_min_compares::hdc00d20cd24ca293
11: 0x10ac53ab1 - <F as test::FnBox<T>>::call_box::h7d01a5d4825fcd4d
12: 0x10ac89e2c - __rust_maybe_catch_panic
13: 0x10ac44a58 - std::sys_common::backtrace::__rust_begin_short_backtrace::h00ee79cb1cc21f6e
14: 0x10ac45827 - std::panicking::try::do_call::ha9fae25707519121
15: 0x10ac89e2c - __rust_maybe_catch_panic
16: 0x10ac4d733 - <F as alloc::boxed::FnBox<A>>::call_box::hc43bdbb6dd582cb8
17: 0x10ac85fab - std::sys::imp::thread::Thread::new::thread_start::h48c72bb09587cbc3
18: 0x7fff774556c0 - _pthread_body
19: 0x7fff7745556c - _pthread_start
from rust-decimal.
Long story short, this is due to rescaling requiring more significant digits than can be "technically" stored in the Decimal number formally (i.e. > 96 bits required).
In this particular case rescale
is only required temporarily so could be optimized to avoid panic since it's throwaway.
from rust-decimal.
Related Issues (20)
- 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
- too rubbish to called rust decimal HOT 3
- checked_powd takes exponentially long time to complete HOT 6
- Scale changes unexpectedly after operations HOT 3
- 1.34.0 breaks with cyclic dependency when installed with "macros" feature HOT 4
- Deserializing `Decimal`s from Postgres using the `db-postgres` feature can lead to invalid `Decimal` instances 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.