Closed MathisWellmann closed 9 months ago
The panic happens when you try to convert a Decimal with absolute value less than 1 and significant bits larger than the number of mantissa bits of the target type. This is clearly a bug. Bubbling the panic up to the caller is not an option in this case. Resolving this issue is not trivial. I have to find a way to avoid rounding twice. I've created issue #13 for this. I will take over your test case, slightly modified to have the same naming and structure as the other test cases.
Underlying bug to be handled via issue #13.
Came across a panic:
I've added a test that highlights the panic. It originates in the
n_signif_bits
function and the overflow should be bubbled up to the caller to allow him to properly handle it. I have a feeling that it has to do with the value being so tiny (or having so many digits after the dot). Not sure what the best way to address this is, but just wanted to share it. Thanks for all the good work done so far, one of my favorite workhorse crates :100: