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

fuookami.ospf.kotlin.utils.operator.Pow.kt Maven / Gradle / Ivy

There is a newer version: 1.0.29
Show newest version
package fuookami.ospf.kotlin.utils.operator

interface Pow {
    fun pow(index: Int): Ret

    fun sqr(): Ret
    fun cub(): Ret
}

interface PowFun {
    fun Self.pow(index: Int): Ret

    fun Self.square(): Ret
    fun Self.cubic(): Ret
}

fun  pow(base: Base, index: Int): Ret
        where Base : Pow {
    return base.pow(index)
}

fun > pow(base: Base, index: Int, func: Func): Ret {
    return func.run {
        base.pow(index)
    }
}

fun  sqr(base: Base): Ret
        where Base : Pow {
    return base.sqr()
}

fun  cub(base: Base): Ret
        where Base : Pow {
    return base.cub()
}

interface PowF {
    fun pow(index: Index): Ret

    fun sqrt(): Ret
    fun cbrt(): Ret
}

fun  pow(base: Base, index: Index): Ret
        where Base : PowF {
    return base.pow(index)
}

fun  sqrt(base: Base): Ret
        where Base : PowF {
    return base.sqrt()
}

fun  cbrt(base: Base): Ret
        where Base : PowF {
    return base.cbrt()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy