We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is this intended behavior? I am using Julia 1.3.1
julia> searchsortedlast([-2, -1, 0, 0, 1, 2], 0.0) 4 julia> searchsortedlast([-2, -1, 0, 0, 1, 2], -0.0) 2
Version information:
julia> versioninfo() Julia Version 1.3.1 Commit 2d5741174c (2019-12-30 21:36 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) CPU: Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.1 (ORCJIT, sandybridge) Environment: JULIA_DEPOT_PATH = /nfs/kshedden/julia_libs
The text was updated successfully, but these errors were encountered:
Yes, intended because
julia> isless(-0.0, 0.0) true julia> isless(0.0, 0.0) false
Otherwise stick to Ints (there is no signed zero in Ints) or use < for Floats
<
julia> searchsortedlast([-2, -1, 0, 0, 1, 2], -0) 4 julia> searchsortedlast([-2, -1, 0, 0, 1, 2], -0.0, lt = <) 4
but do note that < on Floats is not a total order in the sense that
julia> NaN < 0 false julia> 0 < NaN false
so < should typically be avoided in the context of sorting unless you know your values are free of NaNs.
Sorry, something went wrong.
No branches or pull requests
Is this intended behavior? I am using Julia 1.3.1
Version information:
The text was updated successfully, but these errors were encountered: