-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorhelp wantedIndicates that a maintainer wants help on an issue or pull requestIndicates that a maintainer wants help on an issue or pull request
Description
searchsortedfirst
also has a lot of fun bugs with unsigned integers. If you're lucky, it throws an error, but sometimes the results are silently incorrect.
julia> searchsortedfirst(UInt64(2):UInt64(2), 0) # also happens with a UInt64 x
0x0000000000000002
julia> searchsortedfirst(UInt64(2):UInt64(2), 2) # works with a UInt64 x
ERROR: InexactError()
in searchsortedfirst at sort.jl:209
julia> searchsortedlast(UInt64(2):UInt64(2), 0) # also happens with a UInt64 x
0x0000000000000001
julia> searchsorted(UInt64(2):UInt64(2), 2) # works with a UInt64 x
ERROR: InexactError()
in searchsortedfirst at sort.jl:209
in searchsorted at sort.jl:229
julia> searchsortedfirst(UInt64(1):1//2:UInt64(5), 0) # also happens with a UInt64 x
ERROR: OverflowError()
in - at rational.jl:166
in searchsortedfirst at sort.jl:192
julia> searchsortedlast(UInt64(1):1//2:UInt64(5), 0) # also happens with a UInt64 x
ERROR: OverflowError()
in - at rational.jl:166
in searchsortedlast at sort.jl:183
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorhelp wantedIndicates that a maintainer wants help on an issue or pull requestIndicates that a maintainer wants help on an issue or pull request