You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I am trying to calculate sigmoid of &[Decimal] here, which fails while using Decimal but works fine after being converted to f64, is this expected behaviour or a bug?
The long story short is that the way that powd works is it tries to calculate the exponent and then reduce the number back to the correct scale (rounding if necessary). Currently this uses multiplication to derive this - of which behind the scenes multiplication temporarily expands the decimal to 192 bits before shrinking back to 96 bits. Because of this, every "iteration" within powd effectively expands and then shrinks - which of course is not effective and causes the overflow.
What should happen is that the calculation should expand to 192 bits (or more) but not scale back to 96 bits until the very last opportunity. This would help resolve situations like you're seeing above.
Overall, the fix isn't difficult, however requires some critical path refactoring to allow for more lenient multiplication steps.
Hi there, I am trying to calculate
sigmoid
of&[Decimal]
here, which fails while using Decimal but works fine after being converted tof64
, is this expected behaviour or a bug?The text was updated successfully, but these errors were encountered: