Skip to content

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

Open
@Drvi

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

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