Git Product home page Git Product logo

Comments (2)

paupino avatar paupino commented on August 21, 2024

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.

paupino avatar paupino commented on August 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.