Skip to content

∈ throws for Float64 with large value with small range #45747

Closed
@LilithHafner

Description

@LilithHafner
1e40  0:1.0

This errors instead of returning false

ERROR: InexactError: trunc(Int64, 1.0e40)
Stacktrace:
 [1] trunc
   @ ./float.jl:781 [inlined]
 [2] trunc
   @ ./float.jl:354 [inlined]
 [3] round
   @ ./float.jl:359 [inlined]
 [4] _in_range(x::Float64, r::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64})
   @ Base ./range.jl:1396
 [5] in(x::Float64, r::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64})
   @ Base ./range.jl:1400
 [6] top-level scope
   @ REPL[21]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorrangesEverything AbstractRange

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions