Can someone please explain diff between `kotlin.ma...
# stdlib
d
Can someone please explain diff between
kotlin.math.max()
and
kotlin.comparisons.maxOf()
? Both of them seem to be doing the same thing. 2 things I noticed that the later one can compare 3 values also and we can also pass our own comparator. Any other difference than these?
e
max() only works on primitive numeric types, maxOf works on any Comparable (with specializations for numeric types)
👍 1
I see that maxOf/minOf were added in Kotlin 1.1: https://youtrack.jetbrains.com/issue/KT-7417 not sure about max()/min() though
👍 1
z
My favorite feature of maxOf is that IntelliJ won't try to auto-import the jvm function 😜