diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/Primitives.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/Primitives.kt index f1aa721ca53..ec8f7d2403a 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/Primitives.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/Primitives.kt @@ -158,42 +158,42 @@ public final class Byte private constructor() : Number(), Comparable { this.toDouble() / other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Byte): Int = this.toInt() % other.toInt() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Short): Int = this.toInt() % other.toInt() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Int): Int = this.toInt() % other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Long): Long = this.toLong() % other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Float): Float = this.toFloat() % other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -501,42 +501,42 @@ public final class Short private constructor() : Number(), Comparable { this.toDouble() / other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Byte): Int = this.toInt() % other.toInt() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Short): Int = this.toInt() % other.toInt() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Int): Int = this.toInt() % other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Long): Long = this.toLong() % other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Float): Float = this.toFloat() % other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -839,42 +839,42 @@ public final class Int private constructor() : Number(), Comparable { this.toDouble() / other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Byte): Int = this % other.toInt() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Short): Int = this % other.toInt() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @TypedIntrinsic(IntrinsicType.SIGNED_REM) external public operator fun rem(other: Int): Int /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Long): Long = this.toLong() % other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Float): Float = this.toFloat() % other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -1222,42 +1222,42 @@ public final class Long private constructor() : Number(), Comparable { this.toDouble() / other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Byte): Long = this % other.toLong() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Short): Long = this % other.toLong() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Int): Long = this % other.toLong() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @TypedIntrinsic(IntrinsicType.SIGNED_REM) external public operator fun rem(other: Long): Long /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Float): Float = this.toFloat() % other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -1628,42 +1628,42 @@ public final class Float private constructor() : Number(), Comparable { this.toDouble() / other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Byte): Float = this % other.toFloat() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Short): Float = this % other.toFloat() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Int): Float = this % other.toFloat() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Long): Float = this % other.toFloat() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @TypedIntrinsic(IntrinsicType.SIGNED_REM) external public operator fun rem(other: Float): Float /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -1936,42 +1936,42 @@ public final class Double private constructor() : Number(), Comparable { external public operator fun div(other: Double): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Byte): Double = this % other.toDouble() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Short): Double = this % other.toDouble() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Int): Double = this % other.toDouble() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Long): Double = this % other.toDouble() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ public inline operator fun rem(other: Float): Double = this % other.toDouble() /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ diff --git a/libraries/stdlib/js-ir/builtins/Primitives.kt b/libraries/stdlib/js-ir/builtins/Primitives.kt index c5b7d216701..cf8c6595ff5 100644 --- a/libraries/stdlib/js-ir/builtins/Primitives.kt +++ b/libraries/stdlib/js-ir/builtins/Primitives.kt @@ -132,42 +132,42 @@ public class Byte private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Int /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Short): Int /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Int): Int /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Long): Long /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Float): Float /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -420,42 +420,42 @@ public class Short private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Int /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Short): Int /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Int): Int /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Long): Long /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Float): Float /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -705,42 +705,42 @@ public class Int private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Int /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Short): Int /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Int): Int /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Long): Long /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Float): Float /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -1042,42 +1042,42 @@ public class Float private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Float /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Short): Float /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Int): Float /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Long): Float /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Float): Float /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -1298,42 +1298,42 @@ public class Double private constructor() : Number(), Comparable { public operator fun div(other: Double): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Byte): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Short): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Int): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Long): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @SinceKotlin("1.1") public operator fun rem(other: Float): Double /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ diff --git a/libraries/stdlib/js-ir/runtime/long.kt b/libraries/stdlib/js-ir/runtime/long.kt index 04d485f1277..0cff645ac67 100644 --- a/libraries/stdlib/js-ir/runtime/long.kt +++ b/libraries/stdlib/js-ir/runtime/long.kt @@ -154,7 +154,7 @@ public class Long internal constructor( public inline operator fun div(other: Double): Double = toDouble() / other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -162,7 +162,7 @@ public class Long internal constructor( public inline operator fun rem(other: Byte): Long = rem(other.toLong()) /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -170,7 +170,7 @@ public class Long internal constructor( public inline operator fun rem(other: Short): Long = rem(other.toLong()) /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -178,7 +178,7 @@ public class Long internal constructor( public inline operator fun rem(other: Int): Long = rem(other.toLong()) /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -186,7 +186,7 @@ public class Long internal constructor( public operator fun rem(other: Long): Long = modulo(other) /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ @@ -194,7 +194,7 @@ public class Long internal constructor( public inline operator fun rem(other: Float): Float = toFloat() % other /** - * Calculates the remainder of truncating division of this value by the other value. + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). * * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. */ diff --git a/libraries/stdlib/wasm/builtins/kotlin/Primitives.kt b/libraries/stdlib/wasm/builtins/kotlin/Primitives.kt index 4d51ef692ef..f97c5cff30b 100644 --- a/libraries/stdlib/wasm/builtins/kotlin/Primitives.kt +++ b/libraries/stdlib/wasm/builtins/kotlin/Primitives.kt @@ -161,15 +161,15 @@ public class Byte private constructor(public val value: Byte) : Number(), Compar public inline operator fun times(other: Double): Double = this.toDouble() * other - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public inline operator fun div(other: Byte): Int = this.toInt() / other.toInt() - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public inline operator fun div(other: Short): Int = this.toInt() / other.toInt() - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public inline operator fun div(other: Int): Int = this.toInt() / other @@ -197,15 +197,27 @@ public class Byte private constructor(public val value: Byte) : Number(), Compar public inline operator fun rem(other: Int): Int = this.toInt() % other - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Long): Long = this.toLong() % other - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Float): Float = this.toFloat() % other - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Double): Double = this.toDouble() % other @@ -537,19 +549,19 @@ public class Short private constructor(public val value: Short) : Number(), Comp public inline operator fun times(other: Double): Double = this.toDouble() * other - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public inline operator fun div(other: Byte): Int = this.toInt() / other.toInt() - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public inline operator fun div(other: Short): Int = this.toInt() / other.toInt() - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public inline operator fun div(other: Int): Int = this.toInt() / other - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public inline operator fun div(other: Long): Long = this.toLong() / other @@ -561,27 +573,51 @@ public class Short private constructor(public val value: Short) : Number(), Comp public inline operator fun div(other: Double): Double = this.toDouble() / other - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Byte): Int = this.toInt() % other.toInt() - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Short): Int = this.toInt() % other.toInt() - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Int): Int = this.toInt() % other - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Long): Long = this.toLong() % other - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Float): Float = this.toFloat() % other - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Double): Double = this.toDouble() % other @@ -917,19 +953,19 @@ public class Int private constructor(val value: Int) : Number(), Comparable public inline operator fun times(other: Double): Double = this.toDouble() * other - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public inline operator fun div(other: Byte): Int = this / other.toInt() - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public inline operator fun div(other: Short): Int = this / other.toInt() - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public operator fun div(other: Int): Int = if (this == Int.MIN_VALUE && other == -1) Int.MIN_VALUE else wasm_i32_div_s(this, other) - /** Divides this value by the other value. */ + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ public inline operator fun div(other: Long): Long = this.toLong() / other @@ -945,24 +981,44 @@ public class Int private constructor(val value: Int) : Number(), Comparable public inline operator fun rem(other: Byte): Int = this % other.toInt() - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Short): Int = this % other.toInt() - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ @WasmOp(WasmOp.I32_REM_S) public operator fun rem(other: Int): Int = implementedAsIntrinsic - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Long): Long = this.toLong() % other - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Float): Float = this.toFloat() % other - /** Calculates the remainder of dividing this value by the other value. */ + /** + * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor). + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ public inline operator fun rem(other: Double): Double = this.toDouble() % other @@ -1346,19 +1402,19 @@ public class Long private constructor(val value: Long) : Number(), Comparable