Closed david-monroe closed 10 months ago
Thanks for raising this. I performed some analysis and found that (long story short) scale 29 was causing an issue since it was "aligning" to a scale of 29 however reconstructing to a scale of 28. Because a scale of 29 is technically unsupported (except for very small numbers) it made sense to instead force scaling to 28 which effectively solves the issue.
To note, it didn't happen for scale of 30 since the very small number leaked into the high word triggering a full rescale. For scale 28 we didn't see the issue either since it was already within scale.
Note that
num.rescale(30)
creates a value with scale 30 but does not overflow.This happens when reading values with large scale from a database.