# max(x::T, y::T) and min must be commutative!

**URL:** <https://discourse.julialang.org/t/max-x-t-y-t-and-min-must-be-commutative/5165>\
**Category:** Internals & Design\
**Tags:** bug\
**Created:** [August 1, 2017, 2:03pm UTC](https://discourse.julialang.org/t/max-x-t-y-t-and-min-must-be-commutative/5165 "2017-08-01T14:03:28Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [August 2, 2017, 5:11pm UTC](https://discourse.julialang.org/t/max-x-t-y-t-and-min-must-be-commutative/5165/11 "2017-08-02T17:11:03Z")

</div>

Changing the definitions of `min` and `max` to use `isless` seems reasonable, although for non-floating-point types `<` and `isless` should be identical, so arguably the real bug here is that they differ for sets. The fact that `<` and `<=` are defined for sets is quite old and probably not a great idea – we have `⊊` and `⊆` operators that can be used for that. Defining `min` and `max` to compute intersection and union has a certain appeal, but I don’t think it’s what people would really expect, and as noted would be inefficient. It seems more appropriate to introduce generic `meet` and `join` operations.

---

_[View the full topic](https://discourse.julialang.org/t/max-x-t-y-t-and-min-must-be-commutative/5165)._
