You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a preorder, min of two equivalent elements should return the first parameter, and max should return the second. This makes the following properties true:
(min(x,y), max(x,y)) is either (x,y) or (y,x);
(x,y)->(min(x,y), max(x,y)) is a stable sort.
The definition of max at operators.jl:56 is wrong — it returns the first argument for equivalent arguments:
import Base: isless
type Twain
a :: Int
b :: Int
end
isless(x :: Twain, y :: Twain) = x.a < y.a
# max(Twain(2,3), Twain(2,4))
In a preorder,
min
of two equivalent elements should return the first parameter, andmax
should return the second. This makes the following properties true:(min(x,y), max(x,y))
is either(x,y)
or(y,x)
;(x,y)->(min(x,y), max(x,y))
is a stable sort.The definition of
max
at operators.jl:56 is wrong — it returns the first argument for equivalent arguments:You'll find a more detailed discussion in Chapter 7 of http://www.stepanovpapers.com/notes.pdf .
The text was updated successfully, but these errors were encountered: