julia icon indicating copy to clipboard operation
julia copied to clipboard

Implement a `cmp` specialization for ranges

Open LilithHafner opened this issue 3 weeks ago • 1 comments

  • Implement a cmp specialization for ranges
  • Add tests (gen AI helped populate const EXAMPLE_RANGES)

Fixes #60334

LilithHafner avatar Dec 07 '25 03:12 LilithHafner

here is another good stressor

julia> r1 = LinRange(0.3376448676263234, 1.509664528429199, 3);

julia> r2 = range(0.3376448676263234, step=0.5860098304014378, length=3);

julia> isless(r1, r2) || isless(r2, r1) || isequal(r1, r2)
false

I think forcing the fast path to have the same concrete types will resolve this type of edge case

adienes avatar Dec 08 '25 13:12 adienes