Skip to content

incorrect RoundUp conversion of large strings #176

@stevengj

Description

@stevengj

This is wrong, since the result should be exactly representable in Dec128:

julia> Dec128(big(10)^1000, RoundUp)
1.000000000000000000000000000000001e1000

Unfortunately, this might be a bug in the underlying library? All we are doing is converting the BigInt to a string and then calling the library's from_string routine.

As a result, we get incorrect results like:

julia> d128"1e100" == big(10)^100 # correct
true

julia> d128"1e1000" == big(10)^1000 # incorrect
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions