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
Currently, to avoid precision and rounding differences, we unconditionally push FromPositiveReal for Decimal32 to use the approximate algorithm. This is because the iterative multiply/divide paths result in losing a few bits that causes an off-by-one issue with Decimal32 values at the edges (or close to) the max precision of it.
A possible solution might be to convert to Decimal64 and then convert back down to Decimal32 afterwards, though it might still have rounding issues.
Overall, while using the approx algorithm isn't bad, we can probably do better and should look into improving it.
Component(s)
C++
The text was updated successfully, but these errors were encountered:
Describe the enhancement requested
Currently, to avoid precision and rounding differences, we unconditionally push
FromPositiveReal
forDecimal32
to use the approximate algorithm. This is because the iterative multiply/divide paths result in losing a few bits that causes an off-by-one issue with Decimal32 values at the edges (or close to) the max precision of it.A possible solution might be to convert to Decimal64 and then convert back down to Decimal32 afterwards, though it might still have rounding issues.
Overall, while using the approx algorithm isn't bad, we can probably do better and should look into improving it.
Component(s)
C++
The text was updated successfully, but these errors were encountered: