Skip to content

Subtraction and comparison against floats is not robust against float underflow #117

Description

@Drvi
julia> using FixedPointDecimals

julia> fd = reinterpret(FixedDecimal{Int,0}, (2 << 53) + 1)
FixedDecimal{Int64,0}(18014398509481985)

julia> f = Float64(2 << 53) 
1.8014398509481984e16

julia> isless(f, fd) # this is basically asking 18014398509481984 < 18014398509481985 -> true
false

julia> fd - f # this is basically 18014398509481985 - 18014398509481984 -> 1
0.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions