Implement unsigned comparisons
This commit is contained in:
@@ -28,28 +28,28 @@ public inline class UInt internal constructor(private val data: Int) : Comparabl
|
||||
* Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
|
||||
* or a positive number if it's greater than other.
|
||||
*/
|
||||
public operator fun compareTo(other: UByte): Int = TODO()
|
||||
public operator fun compareTo(other: UByte): Int = this.compareTo(other.toUInt())
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
* Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
|
||||
* or a positive number if it's greater than other.
|
||||
*/
|
||||
public operator fun compareTo(other: UShort): Int = TODO()
|
||||
public operator fun compareTo(other: UShort): Int = this.compareTo(other.toUInt())
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
* Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
|
||||
* or a positive number if it's greater than other.
|
||||
*/
|
||||
public override operator fun compareTo(other: UInt): Int = TODO()
|
||||
public override operator fun compareTo(other: UInt): Int = uintCompare(this.data, other.data)
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
* Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
|
||||
* or a positive number if it's greater than other.
|
||||
*/
|
||||
public operator fun compareTo(other: ULong): Int = TODO()
|
||||
public operator fun compareTo(other: ULong): Int = this.toULong().compareTo(other)
|
||||
|
||||
/** Adds the other value to this value. */
|
||||
public operator fun plus(other: UByte): UInt = TODO()
|
||||
|
||||
Reference in New Issue
Block a user