Kactoos

kactoos-jvm / nnl.rocks.kactoos.scalar / AvgOf

AvgOf

class AvgOf : NumberEnvelope

Average of numbers.

Here is how you can use it to fine mathematical average of numbers:

val avg = AvgOf(1, 2, 3).toInt()
val avg = AvgOf(1L, 2L, 3L).toLong()

There is no thread-safety guarantee.

Since 0.4

Constructors

Name Summary
<init> AvgOf(src: Iterable<KScalar<Number>>)
AvgOf(vararg src: Int)
AvgOf(vararg src: Long)
AvgOf(vararg src: Double)
AvgOf(vararg src: Float)
AvgOf(vararg src: KScalar<Number>)
AvgOf(vararg src: Scalar<Number>)

Inherited Functions

Name Summary
invoke open fun invoke(): Double
Get value of this Scalar
toByte fun toByte(): Byte
toChar fun toChar(): Char
toDouble fun toDouble(): Double
toFloat fun toFloat(): Float
toInt fun toInt(): Int
toLong fun toLong(): Long
toShort fun toShort(): Short