@@ -112,9 +112,9 @@ data class Ubyte(var v: Byte = 0) : Number() {
112
112
infix operator fun div (b : Byte ) = Ubyte (toInt() / b.toUInt())
113
113
infix operator fun div (b : Int ) = Ubyte (Integer .divideUnsigned(toInt(), b))
114
114
115
- infix operator fun mod (b : Ubyte ) = Ubyte (toInt() % b.toInt())
116
- infix operator fun mod (b : Byte ) = Ubyte (toInt() % b.toUInt())
117
- infix operator fun mod (b : Int ) = Ubyte (Integer .remainderUnsigned(toInt(), b))
115
+ infix operator fun rem (b : Ubyte ) = Ubyte (toInt() % b.toInt())
116
+ infix operator fun rem (b : Byte ) = Ubyte (toInt() % b.toUInt())
117
+ infix operator fun rem (b : Int ) = Ubyte (Integer .remainderUnsigned(toInt(), b))
118
118
119
119
// TODO add counterparts with res
120
120
infix fun and (b : Ubyte ) = Ubyte (v and b.v)
@@ -192,8 +192,8 @@ data class Uint(var v: Int = 0) : Number() {
192
192
infix operator fun div (b : Uint ) = Uint (Integer .divideUnsigned(v, b.toInt()))
193
193
infix operator fun div (b : Int ) = Uint (Integer .divideUnsigned(v, b))
194
194
195
- infix operator fun mod (b : Uint ) = Uint (Integer .remainderUnsigned(v, b.toInt()))
196
- infix operator fun mod (b : Int ) = Uint (Integer .remainderUnsigned(v, b))
195
+ infix operator fun rem (b : Uint ) = Uint (Integer .remainderUnsigned(v, b.toInt()))
196
+ infix operator fun rem (b : Int ) = Uint (Integer .remainderUnsigned(v, b))
197
197
198
198
infix fun and (b : Uint ) = Uint (v and b.toInt())
199
199
infix fun and (b : Int ) = Uint (v and b)
@@ -264,8 +264,8 @@ data class Ulong(var v: Long = 0) : Number(), Comparable<Ulong> {
264
264
infix operator fun div (b : Ulong ) = Ulong (java.lang.Long .divideUnsigned(v, b.toLong()))
265
265
infix operator fun div (b : Long ) = Ulong (java.lang.Long .divideUnsigned(v, b))
266
266
267
- infix operator fun mod (b : Ulong ) = Ulong (java.lang.Long .remainderUnsigned(v, b.toLong()))
268
- infix operator fun mod (b : Long ) = Ulong (java.lang.Long .remainderUnsigned(v, b))
267
+ infix operator fun rem (b : Ulong ) = Ulong (java.lang.Long .remainderUnsigned(v, b.toLong()))
268
+ infix operator fun rem (b : Long ) = Ulong (java.lang.Long .remainderUnsigned(v, b))
269
269
270
270
infix fun and (b : Ulong ) = Ulong (v and b.toLong())
271
271
infix fun and (b : Long ) = Ulong (v and b)
@@ -359,9 +359,9 @@ data class Ushort(var v: Short = 0) : Number() {
359
359
infix operator fun div (b : Short ) = Ushort (toInt() / b.toUInt())
360
360
infix operator fun div (b : Int ) = Ushort (Integer .divideUnsigned(toInt(), b))
361
361
362
- infix operator fun mod (b : Ushort ) = Ushort (toInt() % b.toInt())
363
- infix operator fun mod (b : Short ) = Ushort (toInt() % b.toUInt())
364
- infix operator fun mod (b : Int ) = Ushort (Integer .remainderUnsigned(toInt(), b))
362
+ infix operator fun rem (b : Ushort ) = Ushort (toInt() % b.toInt())
363
+ infix operator fun rem (b : Short ) = Ushort (toInt() % b.toUInt())
364
+ infix operator fun rem (b : Int ) = Ushort (Integer .remainderUnsigned(toInt(), b))
365
365
366
366
infix fun and (b : Ushort ) = Ushort (v and b.v)
367
367
infix fun and (b : Short ) = Ushort (v and b)
@@ -395,7 +395,7 @@ operator fun Byte.plus(b: Ubyte): Byte = (toUInt() + b.toInt()).toByte()
395
395
operator fun Byte.minus (b : Ubyte ) = (toUInt() - b.toInt()).toByte()
396
396
operator fun Byte.times (b : Ubyte ) = (toUInt() * b.toInt()).toByte()
397
397
operator fun Byte.div (b : Ubyte ) = (toUInt() / b.toInt()).toByte()
398
- operator fun Byte.mod (b : Ubyte ) = (toUInt() % b.toInt()).toByte()
398
+ operator fun Byte.rem (b : Ubyte ) = (toUInt() % b.toInt()).toByte()
399
399
infix fun Byte.and (b : Ubyte ) = (this and b.v).toByte()
400
400
infix fun Byte.or (b : Ubyte ) = (this or b.v).toByte()
401
401
infix fun Byte.xor (b : Ubyte ) = (this xor b.v).toByte()
@@ -409,7 +409,7 @@ operator fun Int.plus(b: Ubyte) = this + b.toInt()
409
409
operator fun Int.minus (b : Ubyte ) = this - b.toInt()
410
410
operator fun Int.times (b : Ubyte ) = this * b.toInt()
411
411
operator fun Int.div (b : Ubyte ) = Integer .divideUnsigned(this , b.toInt())
412
- operator fun Int.mod (b : Ubyte ) = Integer .remainderUnsigned(this , b.toInt())
412
+ operator fun Int.rem (b : Ubyte ) = Integer .remainderUnsigned(this , b.toInt())
413
413
infix fun Int.and (b : Ubyte ) = this and b.toInt()
414
414
infix fun Int.or (b : Ubyte ) = this or b.toInt()
415
415
infix fun Int.xor (b : Ubyte ) = this xor b.toInt()
@@ -423,7 +423,7 @@ operator fun Int.plus(b: Uint) = this + b.toInt()
423
423
operator fun Int.minus (b : Uint ) = this - b.toInt()
424
424
operator fun Int.times (b : Uint ) = this * b.toInt()
425
425
operator fun Int.div (b : Uint ) = Integer .divideUnsigned(this , b.toInt())
426
- operator fun Int.mod (b : Uint ) = Integer .remainderUnsigned(this , b.toInt())
426
+ operator fun Int.rem (b : Uint ) = Integer .remainderUnsigned(this , b.toInt())
427
427
infix fun Int.and (b : Uint ) = this and b.toInt()
428
428
infix fun Int.or (b : Uint ) = this or b.toInt()
429
429
infix fun Int.xor (b : Uint ) = this xor b.toInt()
@@ -437,7 +437,7 @@ operator fun Long.plus(b: Ulong) = this + b.toLong()
437
437
operator fun Long.minus (b : Ulong ) = this - b.toLong()
438
438
operator fun Long.times (b : Ulong ) = this * b.toLong()
439
439
operator fun Long.div (b : Ulong ) = java.lang.Long .divideUnsigned(this , b.toLong())
440
- operator fun Long.mod (b : Ulong ) = java.lang.Long .remainderUnsigned(this , b.toLong())
440
+ operator fun Long.rem (b : Ulong ) = java.lang.Long .remainderUnsigned(this , b.toLong())
441
441
infix fun Long.and (b : Ulong ) = this and b.toLong()
442
442
infix fun Long.or (b : Ulong ) = this or b.toLong()
443
443
infix fun Long.xor (b : Ulong ) = this xor b.toLong()
@@ -449,7 +449,7 @@ operator fun Short.plus(b: Ushort) = (toInt() + b.toInt()).toShort()
449
449
operator fun Short.minus (b : Ushort ) = (toInt() - b.toInt()).toShort()
450
450
operator fun Short.times (b : Ushort ) = (toInt() * b.toInt()).toShort()
451
451
operator fun Short.div (b : Ushort ) = (toUInt() / b.toInt()).toShort()
452
- operator fun Short.mod (b : Ushort ) = (toUInt() % b.toInt()).toShort()
452
+ operator fun Short.rem (b : Ushort ) = (toUInt() % b.toInt()).toShort()
453
453
infix fun Short.and (b : Ushort ) = (this and b.v).toShort()
454
454
infix fun Short.or (b : Ushort ) = (this or b.v).toShort()
455
455
infix fun Short.xor (b : Ushort ) = (this xor b.v).toShort()
@@ -463,7 +463,7 @@ operator fun Int.plus(b: Ushort) = this + b.toInt()
463
463
operator fun Int.minus (b : Ushort ) = this - b.toInt()
464
464
operator fun Int.times (b : Ushort ) = this * b.toInt()
465
465
operator fun Int.div (b : Ushort ) = Integer .divideUnsigned(this , b.toInt())
466
- operator fun Int.mod (b : Ushort ) = Integer .remainderUnsigned(this , b.toInt())
466
+ operator fun Int.rem (b : Ushort ) = Integer .remainderUnsigned(this , b.toInt())
467
467
infix fun Int.and (b : Ushort ) = this and b.toInt()
468
468
infix fun Int.or (b : Ushort ) = this or b.toInt()
469
469
infix fun Int.xor (b : Ushort ) = this xor b.toInt()
0 commit comments