mod

Common
JVM
JS
Native
1.5
fun Byte.mod(other: Byte): Byte
(source)
fun Byte.mod(other: Short): Short
(source)
fun Byte.mod(other: Int): Int
(source)
fun Byte.mod(other: Long): Long
(source)
fun Short.mod(other: Byte): Byte
(source)
fun Short.mod(other: Short): Short
(source)
fun Short.mod(other: Int): Int
(source)
fun Short.mod(other: Long): Long
(source)
fun Int.mod(other: Byte): Byte
(source)
fun Int.mod(other: Short): Short
(source)
fun Int.mod(other: Int): Int
(source)
fun Int.mod(other: Long): Long
(source)
fun Long.mod(other: Byte): Byte
(source)
fun Long.mod(other: Short): Short
(source)
fun Long.mod(other: Int): Int
(source)
fun Long.mod(other: Long): Long
(source)

Calculates the remainder of flooring division of this value (dividend) by the other value (divisor).

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.

Common
JVM
JS
Native
1.5
fun Float.mod(other: Float): Float
(source)
fun Float.mod(other: Double): Double
(source)
fun Double.mod(other: Float): Double
(source)
fun Double.mod(other: Double): Double
(source)

Calculates the remainder of flooring division of this value (dividend) by the other value (divisor).

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.