Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: #116 Decimals are losing precision on decode
Solution: Instead of construct the Decimal arithmetically, build an intermediate Decimal containing the sign and digits, then build the final result with a tuple of `(sign, digits, exponent)`. Since there is no calculation going on, the default precision in the Decimal context does not take effect. Unfortunately this does not work with bigfloat because the exponent in that case is a power of 2 instead of a power of 10.
- Loading branch information
Showing
3 changed files
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters