All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.dshatz.fuzzykat.diffutils.algorithms.PrimitiveUtils.kt Maven / Gradle / Ivy

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