Package-level declarations

Properties

Link copied to clipboard
@get:JvmName(name = "asDegrees")
val Number.asDegrees: Float

Convert this radian number to degree.

Link copied to clipboard
@get:JvmName(name = "asRadians")
val Number.asRadians: Float

Convert this degree number to radian.

Link copied to clipboard

Returns the value of this BigInteger number as a BigDecimal.

val Double.BD: BigDecimal

Returns the value of this Double number as a BigDecimal.

val Float.BD: BigDecimal

Returns the value of this Float number as a BigDecimal.

val Int.BD: BigDecimal

Returns the value of this Int number as a BigDecimal.

val Long.BD: BigDecimal

Returns the value of this Long number as a BigDecimal.

Link copied to clipboard
val Int.BI: BigInteger

Returns the value of this Int number as a BigInteger.

val Long.BI: BigInteger

Returns the value of this Long number as a BigInteger.

Link copied to clipboard
val Number.isEven: Boolean

Is this number even.

Link copied to clipboard
val Number.isOdd: Boolean

Is this number odd.

Functions

Link copied to clipboard
@JvmName(name = "absDouble")
fun DoubleArray.abs(): DoubleArray
@JvmName(name = "absFloat")
fun FloatArray.abs(): FloatArray
@JvmName(name = "absInt")
fun IntArray.abs(): IntArray
@JvmName(name = "absLong")
fun LongArray.abs(): LongArray

Returns the absolute value of the given value Array.

@JvmName(name = "absDouble")
fun Iterable<Double>.abs(): Iterable<Double>
@JvmName(name = "absFloat")
fun Iterable<Float>.abs(): Iterable<Float>
@JvmName(name = "absInt")
fun Iterable<Int>.abs(): Iterable<Int>
@JvmName(name = "absLong")
fun Iterable<Long>.abs(): Iterable<Long>

Returns the absolute value of the given value Iterable.

Link copied to clipboard
infix inline fun <T : Number> T.almostEq(other: T): Boolean

Returns a Boolean if this value almost equals the other value (not equals).

Link copied to clipboard
inline fun <T : Number> Array<T>.ceil(): DoubleArray

Rounds the given value Array to an integer towards positive infinity.

inline fun <T : Number> Iterable<T>.ceil(): Iterable<Double>

Rounds the given value Iterable to an integer towards positive infinity.

Link copied to clipboard
inline fun <T : Number> Array<T>.exp(): DoubleArray

Computes Euler's number e raised to the power of the value Array.

inline fun <T : Number> Iterable<T>.exp(): Iterable<Double>

Computes Euler's number e raised to the power of the value Iterable.

Link copied to clipboard
@JvmOverloads
tailrec fun fact(n: Long, run: Long = 1): Long

Calculate factorial of n.

Link copied to clipboard
@JvmOverloads
tailrec fun fib(n: Long, first: Long = 0, second: Long = 1): Long

Calculate fibonacci of n.

Link copied to clipboard
inline fun <T : Number> Array<T>.floor(): DoubleArray

Rounds the given value Array to an integer towards negative infinity.

inline fun <T : Number> Iterable<T>.floor(): Iterable<Double>

Rounds the given value Iterable to an integer towards negative infinity.

Link copied to clipboard
inline fun <T : Number> Array<T>.ln(): DoubleArray

Computes the natural logarithm (base E) of the value Array.

inline fun <T : Number> Iterable<T>.ln(): Iterable<Double>

Computes the natural logarithm (base E) of the value Iterable.

Link copied to clipboard
infix inline fun <T : Number> T.log(base: T): Double

Computes the logarithm of the value x to the given base.

infix inline fun <T : Number> T.log(array: Array<T>): DoubleArray

Computes the logarithm of the value x to the given Array bases.

infix inline fun <T : Number> T.log(iterable: Iterable<T>): Iterable<Double>

Computes the logarithm of the value x to the given Iterable bases.

infix inline fun <T : Number> Array<T>.log(number: T): DoubleArray

Computes the logarithm of the Array values to the given base.

infix inline fun <T : Number> Iterable<T>.log(number: T): Iterable<Double>

Computes the logarithm of the Iterable values to the given base.

Link copied to clipboard
inline fun <T : Number> Array<T>.log10(): DoubleArray

Computes the common logarithm (base 10) of the value Array.

inline fun <T : Number> Iterable<T>.log10(): Iterable<Double>

Computes the common logarithm (base 10) of the value Iterable.

Link copied to clipboard
inline fun <T : Number> Array<T>.log2(): DoubleArray

Computes the binary logarithm (base 2) of the value Array.

inline fun <T : Number> Iterable<T>.log2(): Iterable<Double>

Computes the binary logarithm (base 2) of the value Iterable.

Link copied to clipboard
inline fun <T> Array<T>.median(): Pair<T, T?>

Computes the median of the value Array.

inline fun <T> Iterable<T>.median(): Pair<T, T?>

Computes the median of the value Iterable.

Link copied to clipboard
inline fun <T> Array<T>.mode(): List<T>

Computes the mode of the value Array.

inline fun <T> Iterable<T>.mode(): List<T>

Computes the mode of the value Iterable.

Link copied to clipboard
infix inline fun <T : Number> T.perc(percentage: T): Double

Calculate percentage of this value.

Link copied to clipboard
infix inline fun <T : Number> T.pow(number: T): Double

Raises this value to the power number.

infix inline fun <T : Number> T.pow(array: Array<T>): DoubleArray

Raises this value to the power array.

infix inline fun <T : Number> T.pow(iterable: Iterable<T>): Iterable<Double>

Raises this value to the power iterable.

infix inline fun <T : Number> Array<T>.pow(number: T): DoubleArray

Raises this Array to the power number.

infix inline fun <T : Number> Iterable<T>.pow(number: T): Iterable<Double>

Raises this Iterable to the power number.

Link copied to clipboard
@JvmOverloads
fun round(number: Double, digits: Int = 0): Double
@JvmOverloads
fun round(number: Float, digits: Int = 0): Float

Rounds the given value number towards the closest integer with digits of rounding.

Link copied to clipboard
fun DoubleArray.round(): DoubleArray
fun FloatArray.round(): FloatArray

Rounds the given value Array towards the closest integer with ties rounded towards even integer.

@JvmName(name = "roundDouble")
fun Iterable<Double>.round(): Iterable<Double>
@JvmName(name = "roundFloat")
fun Iterable<Float>.round(): Iterable<Float>

Rounds the given value Iterable towards the closest integer with ties rounded towards even integer.

@JvmName(name = "roundExtension")
fun Double.round(digits: Int = 0): Double
@JvmName(name = "roundExtension")
fun Float.round(digits: Int = 0): Float

Rounds the given value this towards the closest integer with digits of rounding.

Link copied to clipboard
inline fun <T : Number> Array<T>.sign(): DoubleArray

Returns the sign of the given value Array:

inline fun <T : Number> Iterable<T>.sign(): Iterable<Double>

Returns the sign of the given value Iterable:

Link copied to clipboard
inline fun <T : Number> Array<T>.sqrt(): DoubleArray

Computes the positive square root of the value Array.

inline fun <T : Number> Iterable<T>.sqrt(): Iterable<Double>

Computes the positive square root of the value Iterable.

Link copied to clipboard
inline fun <T : Number> Array<T>.std(): Double

Computes the standard division of the value Array.

inline fun <T : Number> Iterable<T>.std(): Double

Computes the standard division of the value Iterable.

Link copied to clipboard
inline fun <T : Number> Array<T>.truncate(): DoubleArray

Rounds the given value Array to an integer towards zero.

inline fun <T : Number> Iterable<T>.truncate(): Iterable<Double>

Rounds the given value Iterable to an integer towards zero.

Link copied to clipboard
inline fun <T : Number> Array<T>.variance(): Double

Computes the variance of the value Array.

inline fun <T : Number> Iterable<T>.variance(): Double

Computes the variance of the value Iterable.