compareTo

operator external fun compareTo(other: Byte): Int(source)
operator external fun compareTo(other: Short): Int(source)
open operator external override fun compareTo(other: Int): Int(source)
operator external fun compareTo(other: Long): Int(source)

Compares this value with other after numeric promotion.

Return

-1, 0 or 1 when this value is less than, equal to or greater than other.

Parameters

other

value to compare with.


operator external fun compareTo(other: Float): Int(source)

Compares this value with other after numeric promotion.

Operands use Float precision; large integers may round. NaN compares equal to NaN and above every number. Negative zero compares below positive zero. This total order differs from primitive equality and relational operators involving NaN or signed zero.

Return

-1, 0 or 1 when this value is less than, equal to or greater than other.

Parameters

other

value to compare with.


operator external fun compareTo(other: Double): Int(source)

Compares this value with other after numeric promotion.

Operands use Double precision; large integers may round. NaN compares equal to NaN and above every number. Negative zero compares below positive zero. This total order differs from primitive equality and relational operators involving NaN or signed zero.

Return

-1, 0 or 1 when this value is less than, equal to or greater than other.

Parameters

other

value to compare with.