commonMain.com.dshatz.fuzzykat.diffutils.algorithms.PrimitiveUtils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fuzzyKat-jvm Show documentation
Show all versions of fuzzyKat-jvm Show documentation
Fuzzy search for Kotlin Multiplatform
The newest version!
package com.dshatz.fuzzykat.diffutils.algorithms
internal object PrimitiveUtils {
fun max(vararg elems: Double): Double {
if (elems.isEmpty()) return 0.0
var best = elems[0]
for (t in elems) {
if (t > best) {
best = t
}
}
return best
}
fun max(vararg elems: Int): Int {
if (elems.size == 0) return 0
var best = elems[0]
for (t in elems) {
if (t > best) {
best = t
}
}
return best
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy