rem

operator external fun rem(other: Byte): Int(source)
operator external fun rem(other: Short): Int(source)
operator external fun rem(other: Int): Int(source)

Returns the remainder after dividing this value by other.

The quotient truncates towards zero; a nonzero remainder has the dividend's sign.

Return

the Int remainder.

Parameters

other

divisor.

Throws


operator external fun rem(other: Long): Long(source)

Returns the remainder after dividing this value by other.

The quotient truncates towards zero; a nonzero remainder has the dividend's sign.

Return

the Long remainder.

Parameters

other

divisor.

Throws


operator external fun rem(other: Float): Float(source)

Returns the remainder after dividing this value by other.

Operands are converted to Float before the operation; integral precision can be lost. Floating results follow IEEE arithmetic, including signed zeros, infinities and NaN. Uses a quotient truncated towards zero, rather than IEEE nearest-integer remainder. A zero divisor or infinite dividend produces NaN; a finite dividend modulo infinity is unchanged.

Return

the Float remainder.

Parameters

other

divisor.


operator external fun rem(other: Double): Double(source)

Returns the remainder after dividing this value by other.

Operands are converted to Double before the operation; integral precision can be lost. Floating results follow IEEE arithmetic, including signed zeros, infinities and NaN. Uses a quotient truncated towards zero, rather than IEEE nearest-integer remainder. A zero divisor or infinite dividend produces NaN; a finite dividend modulo infinity is unchanged.

Return

the Double remainder.

Parameters

other

divisor.