-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
2 additions
and
0 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
3e9b48f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the README you suggest using BigFloat instead of Decimal. BigFloat is not a good replacement for Decimal. Although it uses more bits to store the floats than Float64, it is still a binary float format that doesn't provide an exact representation for all floats.
One example:
julia> x = trunc(BigFloat("2.10") * 100) / 100
2.090000000000000000000000000000000000000000000000000000000000000000000000000015e+00 with 256 bits of precision
julia> @printf("%.2f\n", x) # lost a penny
2.09
A Decimal package is an important compliment to BigFloat.
3e9b48f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I guess I misunderstood the purpose of BigFloat. I'll have to come back and finish Decimal when I've got a bit of time, then!