mod

inline fun Byte.mod(other: Byte): Byte
inline fun Byte.mod(other: Short): Short
inline fun Byte.mod(other: Int): Int
inline fun Byte.mod(other: Long): Long
inline fun Short.mod(other: Byte): Byte
inline fun Short.mod(other: Short): Short
inline fun Short.mod(other: Int): Int
inline fun Short.mod(other: Long): Long
inline fun Int.mod(other: Byte): Byte
inline fun Int.mod(other: Short): Short
inline fun Int.mod(other: Int): Int
inline fun Int.mod(other: Long): Long
inline fun Long.mod(other: Byte): Byte
inline fun Long.mod(other: Short): Short
inline fun Long.mod(other: Int): Int
inline fun Long.mod(other: Long): Long

Calculates the remainder of flooring division of this value by the other value.

The result is either zero or has the same sign as the divisor and has the absolute value less than the absolute value of the divisor.

Since Kotlin

1.5

inline fun Float.mod(other: Float): Float
inline fun Float.mod(other: Double): Double
inline fun Double.mod(other: Float): Double
inline fun Double.mod(other: Double): Double

Calculates the remainder of flooring division of this value by the other value.

The result is either zero or has the same sign as the divisor and has the absolute value less than the absolute value of the divisor.

If the result cannot be represented exactly, it is rounded to the nearest representable number. In this case the absolute value of the result can be less than or equal to the absolute value of the divisor.

Since Kotlin

1.5