[Generator] Always put expression body on a new line

This commit is contained in:
Ilya Gorbunov
2023-08-29 04:43:07 +02:00
committed by Space Team
parent 68a9b9c312
commit 1c149925b7
13 changed files with 463 additions and 277 deletions
+32 -16
View File
@@ -27,36 +27,43 @@ internal constructor(private val value: Int) : Comparable<Char> {
* or a positive number if it's greater than other.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun compareTo(other: Char): Int = value - other.value
public override fun compareTo(other: Char): Int =
value - other.value
/** Adds the other Int value to this value resulting a Char. */
@kotlin.internal.IntrinsicConstEvaluation
public operator fun plus(other: Int): Char = (value + other).toChar()
public operator fun plus(other: Int): Char =
(value + other).toChar()
/** Subtracts the other Char value from this value resulting an Int. */
@kotlin.internal.IntrinsicConstEvaluation
public operator fun minus(other: Char): Int = value - other.value
public operator fun minus(other: Char): Int =
value - other.value
/** Subtracts the other Int value from this value resulting a Char. */
@kotlin.internal.IntrinsicConstEvaluation
public operator fun minus(other: Int): Char = (value - other).toChar()
public operator fun minus(other: Int): Char =
(value - other).toChar()
/**
* Returns this value incremented by one.
*
* @sample samples.misc.Builtins.inc
*/
public operator fun inc(): Char = (value + 1).toChar()
public operator fun inc(): Char =
(value + 1).toChar()
/**
* Returns this value decremented by one.
*
* @sample samples.misc.Builtins.dec
*/
public operator fun dec(): Char = (value - 1).toChar()
public operator fun dec(): Char =
(value - 1).toChar()
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Char): CharRange = CharRange(this, other)
public operator fun rangeTo(other: Char): CharRange =
CharRange(this, other)
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -65,47 +72,55 @@ internal constructor(private val value: Int) : Comparable<Char> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Char): CharRange = this until other
public operator fun rangeUntil(other: Char): CharRange =
this until other
/** Returns the value of this character as a `Byte`. */
@Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code.toByte()"))
@DeprecatedSinceKotlin(warningSince = "1.5")
@kotlin.internal.IntrinsicConstEvaluation
public fun toByte(): Byte = value.toByte()
public fun toByte(): Byte =
value.toByte()
/** Returns the value of this character as a `Char`. */
@kotlin.internal.IntrinsicConstEvaluation
public fun toChar(): Char = this
public fun toChar(): Char =
this
/** Returns the value of this character as a `Short`. */
@Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code.toShort()"))
@DeprecatedSinceKotlin(warningSince = "1.5")
@kotlin.internal.IntrinsicConstEvaluation
public fun toShort(): Short = value.toShort()
public fun toShort(): Short =
value.toShort()
/** Returns the value of this character as a `Int`. */
@Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code"))
@DeprecatedSinceKotlin(warningSince = "1.5")
@kotlin.internal.IntrinsicConstEvaluation
public fun toInt(): Int = value
public fun toInt(): Int =
value
/** Returns the value of this character as a `Long`. */
@Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code.toLong()"))
@DeprecatedSinceKotlin(warningSince = "1.5")
@kotlin.internal.IntrinsicConstEvaluation
public fun toLong(): Long = value.toLong()
public fun toLong(): Long =
value.toLong()
/** Returns the value of this character as a `Float`. */
@Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code.toFloat()"))
@DeprecatedSinceKotlin(warningSince = "1.5")
@kotlin.internal.IntrinsicConstEvaluation
public fun toFloat(): Float = value.toFloat()
public fun toFloat(): Float =
value.toFloat()
/** Returns the value of this character as a `Double`. */
@Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code.toDouble()"))
@DeprecatedSinceKotlin(warningSince = "1.5")
@kotlin.internal.IntrinsicConstEvaluation
public fun toDouble(): Double = value.toDouble()
public fun toDouble(): Double =
value.toDouble()
// TODO implicit usages of toString and valueOf must be covered in DCE
@kotlin.internal.IntrinsicConstEvaluation
@@ -121,7 +136,8 @@ internal constructor(private val value: Int) : Comparable<Char> {
return this.value == other.value
}
public override fun hashCode(): Int = value
public override fun hashCode(): Int =
value
companion object {
/**
+148 -74
View File
@@ -275,7 +275,8 @@ public class Byte private constructor() : Number(), Comparable<Byte> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Byte): IntRange = this until other
public operator fun rangeUntil(other: Byte): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -284,7 +285,8 @@ public class Byte private constructor() : Number(), Comparable<Byte> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Short): IntRange = this until other
public operator fun rangeUntil(other: Short): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -293,7 +295,8 @@ public class Byte private constructor() : Number(), Comparable<Byte> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Int): IntRange = this until other
public operator fun rangeUntil(other: Int): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -302,7 +305,8 @@ public class Byte private constructor() : Number(), Comparable<Byte> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Long): LongRange = this until other
public operator fun rangeUntil(other: Long): LongRange =
this until other
/** Returns this value. */
@kotlin.internal.IntrinsicConstEvaluation
@@ -644,7 +648,8 @@ public class Short private constructor() : Number(), Comparable<Short> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Byte): IntRange = this until other
public operator fun rangeUntil(other: Byte): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -653,7 +658,8 @@ public class Short private constructor() : Number(), Comparable<Short> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Short): IntRange = this until other
public operator fun rangeUntil(other: Short): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -662,7 +668,8 @@ public class Short private constructor() : Number(), Comparable<Short> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Int): IntRange = this until other
public operator fun rangeUntil(other: Int): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -671,7 +678,8 @@ public class Short private constructor() : Number(), Comparable<Short> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Long): LongRange = this until other
public operator fun rangeUntil(other: Long): LongRange =
this until other
/**
* Converts this [Short] value to [Byte].
@@ -1011,7 +1019,8 @@ public class Int private constructor() : Number(), Comparable<Int> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Byte): IntRange = this until other
public operator fun rangeUntil(other: Byte): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1020,7 +1029,8 @@ public class Int private constructor() : Number(), Comparable<Int> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Short): IntRange = this until other
public operator fun rangeUntil(other: Short): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1029,7 +1039,8 @@ public class Int private constructor() : Number(), Comparable<Int> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Int): IntRange = this until other
public operator fun rangeUntil(other: Int): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1038,7 +1049,8 @@ public class Int private constructor() : Number(), Comparable<Int> {
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Long): LongRange = this until other
public operator fun rangeUntil(other: Long): LongRange =
this until other
/**
* Shifts this value left by the [bitCount] number of bits.
@@ -1192,7 +1204,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
* or a positive number if it's greater than other.
*/
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun compareTo(other: Byte): Int = this.compareTo(other.toLong())
public inline operator fun compareTo(other: Byte): Int =
this.compareTo(other.toLong())
/**
* Compares this value with the specified value for order.
@@ -1200,7 +1213,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
* or a positive number if it's greater than other.
*/
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun compareTo(other: Short): Int = this.compareTo(other.toLong())
public inline operator fun compareTo(other: Short): Int =
this.compareTo(other.toLong())
/**
* Compares this value with the specified value for order.
@@ -1208,7 +1222,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
* or a positive number if it's greater than other.
*/
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun compareTo(other: Int): Int = this.compareTo(other.toLong())
public inline operator fun compareTo(other: Int): Int =
this.compareTo(other.toLong())
/**
* Compares this value with the specified value for order.
@@ -1216,7 +1231,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
* or a positive number if it's greater than other.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override operator fun compareTo(other: Long): Int = this.compare(other)
public override operator fun compareTo(other: Long): Int =
this.compare(other)
/**
* Compares this value with the specified value for order.
@@ -1224,7 +1240,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
* or a positive number if it's greater than other.
*/
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun compareTo(other: Float): Int = this.toFloat().compareTo(other)
public inline operator fun compareTo(other: Float): Int =
this.toFloat().compareTo(other)
/**
* Compares this value with the specified value for order.
@@ -1232,103 +1249,128 @@ public class Long internal constructor(internal val low: Int, internal val high:
* or a positive number if it's greater than other.
*/
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun compareTo(other: Double): Int = this.toDouble().compareTo(other)
public inline operator fun compareTo(other: Double): Int =
this.toDouble().compareTo(other)
/** Adds the other value to this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun plus(other: Byte): Long = this.plus(other.toLong())
public inline operator fun plus(other: Byte): Long =
this.plus(other.toLong())
/** Adds the other value to this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun plus(other: Short): Long = this.plus(other.toLong())
public inline operator fun plus(other: Short): Long =
this.plus(other.toLong())
/** Adds the other value to this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun plus(other: Int): Long = this.plus(other.toLong())
public inline operator fun plus(other: Int): Long =
this.plus(other.toLong())
/** Adds the other value to this value. */
@kotlin.internal.IntrinsicConstEvaluation
public operator fun plus(other: Long): Long = this.add(other)
public operator fun plus(other: Long): Long =
this.add(other)
/** Adds the other value to this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun plus(other: Float): Float = this.toFloat().plus(other)
public inline operator fun plus(other: Float): Float =
this.toFloat().plus(other)
/** Adds the other value to this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun plus(other: Double): Double = this.toDouble().plus(other)
public inline operator fun plus(other: Double): Double =
this.toDouble().plus(other)
/** Subtracts the other value from this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun minus(other: Byte): Long = this.minus(other.toLong())
public inline operator fun minus(other: Byte): Long =
this.minus(other.toLong())
/** Subtracts the other value from this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun minus(other: Short): Long = this.minus(other.toLong())
public inline operator fun minus(other: Short): Long =
this.minus(other.toLong())
/** Subtracts the other value from this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun minus(other: Int): Long = this.minus(other.toLong())
public inline operator fun minus(other: Int): Long =
this.minus(other.toLong())
/** Subtracts the other value from this value. */
@kotlin.internal.IntrinsicConstEvaluation
public operator fun minus(other: Long): Long = this.subtract(other)
public operator fun minus(other: Long): Long =
this.subtract(other)
/** Subtracts the other value from this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun minus(other: Float): Float = this.toFloat().minus(other)
public inline operator fun minus(other: Float): Float =
this.toFloat().minus(other)
/** Subtracts the other value from this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun minus(other: Double): Double = this.toDouble().minus(other)
public inline operator fun minus(other: Double): Double =
this.toDouble().minus(other)
/** Multiplies this value by the other value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun times(other: Byte): Long = this.times(other.toLong())
public inline operator fun times(other: Byte): Long =
this.times(other.toLong())
/** Multiplies this value by the other value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun times(other: Short): Long = this.times(other.toLong())
public inline operator fun times(other: Short): Long =
this.times(other.toLong())
/** Multiplies this value by the other value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun times(other: Int): Long = this.times(other.toLong())
public inline operator fun times(other: Int): Long =
this.times(other.toLong())
/** Multiplies this value by the other value. */
@kotlin.internal.IntrinsicConstEvaluation
public operator fun times(other: Long): Long = this.multiply(other)
public operator fun times(other: Long): Long =
this.multiply(other)
/** Multiplies this value by the other value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun times(other: Float): Float = this.toFloat().times(other)
public inline operator fun times(other: Float): Float =
this.toFloat().times(other)
/** Multiplies this value by the other value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun times(other: Double): Double = this.toDouble().times(other)
public inline operator fun times(other: Double): Double =
this.toDouble().times(other)
/** Divides this value by the other value, truncating the result to an integer that is closer to zero. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun div(other: Byte): Long = this.div(other.toLong())
public inline operator fun div(other: Byte): Long =
this.div(other.toLong())
/** Divides this value by the other value, truncating the result to an integer that is closer to zero. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun div(other: Short): Long = this.div(other.toLong())
public inline operator fun div(other: Short): Long =
this.div(other.toLong())
/** Divides this value by the other value, truncating the result to an integer that is closer to zero. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun div(other: Int): Long = this.div(other.toLong())
public inline operator fun div(other: Int): Long =
this.div(other.toLong())
/** Divides this value by the other value, truncating the result to an integer that is closer to zero. */
@kotlin.internal.IntrinsicConstEvaluation
public operator fun div(other: Long): Long = this.divide(other)
public operator fun div(other: Long): Long =
this.divide(other)
/** Divides this value by the other value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun div(other: Float): Float = this.toFloat().div(other)
public inline operator fun div(other: Float): Float =
this.toFloat().div(other)
/** Divides this value by the other value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun div(other: Double): Double = this.toDouble().div(other)
public inline operator fun div(other: Double): Double =
this.toDouble().div(other)
/**
* Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
@@ -1337,7 +1379,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
*/
@SinceKotlin("1.1")
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun rem(other: Byte): Long = this.rem(other.toLong())
public inline operator fun rem(other: Byte): Long =
this.rem(other.toLong())
/**
* Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
@@ -1346,7 +1389,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
*/
@SinceKotlin("1.1")
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun rem(other: Short): Long = this.rem(other.toLong())
public inline operator fun rem(other: Short): Long =
this.rem(other.toLong())
/**
* Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
@@ -1355,7 +1399,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
*/
@SinceKotlin("1.1")
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun rem(other: Int): Long = this.rem(other.toLong())
public inline operator fun rem(other: Int): Long =
this.rem(other.toLong())
/**
* Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
@@ -1364,7 +1409,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
*/
@SinceKotlin("1.1")
@kotlin.internal.IntrinsicConstEvaluation
public operator fun rem(other: Long): Long = this.modulo(other)
public operator fun rem(other: Long): Long =
this.modulo(other)
/**
* Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
@@ -1373,7 +1419,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
*/
@SinceKotlin("1.1")
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun rem(other: Float): Float = this.toFloat().rem(other)
public inline operator fun rem(other: Float): Float =
this.toFloat().rem(other)
/**
* Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
@@ -1382,29 +1429,34 @@ public class Long internal constructor(internal val low: Int, internal val high:
*/
@SinceKotlin("1.1")
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun rem(other: Double): Double = this.toDouble().rem(other)
public inline operator fun rem(other: Double): Double =
this.toDouble().rem(other)
/**
* Returns this value incremented by one.
*
* @sample samples.misc.Builtins.inc
*/
public operator fun inc(): Long = this + 1L
public operator fun inc(): Long =
this + 1L
/**
* Returns this value decremented by one.
*
* @sample samples.misc.Builtins.dec
*/
public operator fun dec(): Long = this - 1L
public operator fun dec(): Long =
this - 1L
/** Returns this value. */
@kotlin.internal.IntrinsicConstEvaluation
public inline operator fun unaryPlus(): Long = this
public inline operator fun unaryPlus(): Long =
this
/** Returns the negative of this value. */
@kotlin.internal.IntrinsicConstEvaluation
public operator fun unaryMinus(): Long = this.inv() + 1L
public operator fun unaryMinus(): Long =
this.inv() + 1L
/** Creates a range from this value to the specified [other] value. */
public operator fun rangeTo(other: Byte): LongRange =
@@ -1429,7 +1481,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Byte): LongRange = this until other
public operator fun rangeUntil(other: Byte): LongRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1438,7 +1491,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Short): LongRange = this until other
public operator fun rangeUntil(other: Short): LongRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1447,7 +1501,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Int): LongRange = this until other
public operator fun rangeUntil(other: Int): LongRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1456,7 +1511,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Long): LongRange = this until other
public operator fun rangeUntil(other: Long): LongRange =
this until other
/**
* Shifts this value left by the [bitCount] number of bits.
@@ -1465,7 +1521,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
* The shift distance actually used is therefore always in the range `0..63`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public infix fun shl(bitCount: Int): Long = shiftLeft(bitCount)
public infix fun shl(bitCount: Int): Long =
shiftLeft(bitCount)
/**
* Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with copies of the sign bit.
@@ -1474,7 +1531,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
* The shift distance actually used is therefore always in the range `0..63`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public infix fun shr(bitCount: Int): Long = shiftRight(bitCount)
public infix fun shr(bitCount: Int): Long =
shiftRight(bitCount)
/**
* Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with zeros.
@@ -1483,23 +1541,28 @@ public class Long internal constructor(internal val low: Int, internal val high:
* The shift distance actually used is therefore always in the range `0..63`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public infix fun ushr(bitCount: Int): Long = shiftRightUnsigned(bitCount)
public infix fun ushr(bitCount: Int): Long =
shiftRightUnsigned(bitCount)
/** Performs a bitwise AND operation between the two values. */
@kotlin.internal.IntrinsicConstEvaluation
public infix fun and(other: Long): Long = Long(this.low and other.low, this.high and other.high)
public infix fun and(other: Long): Long =
Long(this.low and other.low, this.high and other.high)
/** Performs a bitwise OR operation between the two values. */
@kotlin.internal.IntrinsicConstEvaluation
public infix fun or(other: Long): Long = Long(this.low or other.low, this.high or other.high)
public infix fun or(other: Long): Long =
Long(this.low or other.low, this.high or other.high)
/** Performs a bitwise XOR operation between the two values. */
@kotlin.internal.IntrinsicConstEvaluation
public infix fun xor(other: Long): Long = Long(this.low xor other.low, this.high xor other.high)
public infix fun xor(other: Long): Long =
Long(this.low xor other.low, this.high xor other.high)
/** Inverts the bits in this value. */
@kotlin.internal.IntrinsicConstEvaluation
public fun inv(): Long = Long(low.inv(), high.inv())
public fun inv(): Long =
Long(low.inv(), high.inv())
/**
* Converts this [Long] value to [Byte].
@@ -1510,7 +1573,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
* The resulting `Byte` value is represented by the least significant 8 bits of this `Long` value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toByte(): Byte = low.toByte()
public override fun toByte(): Byte =
low.toByte()
/**
* Converts this [Long] value to [Char].
@@ -1523,7 +1587,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
@Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()"))
@DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "2.3")
@kotlin.internal.IntrinsicConstEvaluation
public override fun toChar(): Char = low.toChar()
public override fun toChar(): Char =
low.toChar()
/**
* Converts this [Long] value to [Short].
@@ -1534,7 +1599,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
* The resulting `Short` value is represented by the least significant 16 bits of this `Long` value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toShort(): Short = low.toShort()
public override fun toShort(): Short =
low.toShort()
/**
* Converts this [Long] value to [Int].
@@ -1545,11 +1611,13 @@ public class Long internal constructor(internal val low: Int, internal val high:
* The resulting `Int` value is represented by the least significant 32 bits of this `Long` value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toInt(): Int = low
public override fun toInt(): Int =
low
/** Returns this value. */
@kotlin.internal.IntrinsicConstEvaluation
public override fun toLong(): Long = this
public override fun toLong(): Long =
this
/**
* Converts this [Long] value to [Float].
@@ -1559,7 +1627,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
* the one with zero at least significant bit of mantissa is selected.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toFloat(): Float = toDouble().toFloat()
public override fun toFloat(): Float =
toDouble().toFloat()
/**
* Converts this [Long] value to [Double].
@@ -1569,15 +1638,19 @@ public class Long internal constructor(internal val low: Int, internal val high:
* the one with zero at least significant bit of mantissa is selected.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toDouble(): Double = toNumber()
public override fun toDouble(): Double =
toNumber()
@kotlin.internal.IntrinsicConstEvaluation
public override fun toString(): String = this.toStringImpl(radix = 10)
public override fun toString(): String =
this.toStringImpl(radix = 10)
@kotlin.internal.IntrinsicConstEvaluation
public override fun equals(other: Any?): Boolean = other is Long && equalsLong(other)
public override fun equals(other: Any?): Boolean =
other is Long && equalsLong(other)
public override fun hashCode(): Int = hashCode(this)
public override fun hashCode(): Int =
hashCode(this)
// This method is used by JavaScript to convert objects of type Long to primitives.
// This is essential for the JavaScript interop.
@@ -1586,7 +1659,8 @@ public class Long internal constructor(internal val low: Int, internal val high:
// Because `kotlin.Number` is a supertype of `Long` too, there has to be a way for JS to know how to handle Longs.
// See KT-50202
@JsName("valueOf")
internal fun valueOf(): Double = toDouble()
internal fun valueOf(): Double =
toDouble()
}
/** Represents a single-precision 32-bit IEEE 754 floating point number. */
@@ -322,7 +322,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Byte): IntRange = this until other
public operator fun rangeUntil(other: Byte): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -331,7 +332,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Short): IntRange = this until other
public operator fun rangeUntil(other: Short): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -340,7 +342,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Int): IntRange = this until other
public operator fun rangeUntil(other: Int): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -349,7 +352,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Long): LongRange = this until other
public operator fun rangeUntil(other: Long): LongRange =
this until other
/** Returns this value. */
@kotlin.internal.IntrinsicConstEvaluation
@@ -367,7 +371,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
@Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()"))
@DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "2.3")
@kotlin.internal.IntrinsicConstEvaluation
public override fun toChar(): Char = reinterpretAsInt().reinterpretAsChar()
public override fun toChar(): Char =
reinterpretAsInt().reinterpretAsChar()
/**
* Converts this [Byte] value to [Short].
@@ -378,7 +383,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
* whereas the most significant 8 bits are filled with the sign bit of this value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toShort(): Short = reinterpretAsInt().reinterpretAsShort()
public override fun toShort(): Short =
reinterpretAsInt().reinterpretAsShort()
/**
* Converts this [Byte] value to [Int].
@@ -389,7 +395,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
* whereas the most significant 24 bits are filled with the sign bit of this value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toInt(): Int = reinterpretAsInt()
public override fun toInt(): Int =
reinterpretAsInt()
/**
* Converts this [Byte] value to [Long].
@@ -400,7 +407,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
* whereas the most significant 56 bits are filled with the sign bit of this value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toLong(): Long = wasm_i64_extend_i32_s(this.toInt())
public override fun toLong(): Long =
wasm_i64_extend_i32_s(this.toInt())
/**
* Converts this [Byte] value to [Float].
@@ -408,7 +416,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
* The resulting `Float` value represents the same numerical value as this `Byte`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toFloat(): Float = wasm_f32_convert_i32_s(this.toInt())
public override fun toFloat(): Float =
wasm_f32_convert_i32_s(this.toInt())
/**
* Converts this [Byte] value to [Double].
@@ -416,7 +425,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
* The resulting `Double` value represents the same numerical value as this `Byte`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toDouble(): Double = wasm_f64_convert_i32_s(this.toInt())
public override fun toDouble(): Double =
wasm_f64_convert_i32_s(this.toInt())
@kotlin.internal.IntrinsicConstEvaluation
public override fun toString(): String =
@@ -426,7 +436,8 @@ public class Byte private constructor(private val value: Byte) : Number(), Compa
public override fun equals(other: Any?): Boolean =
other is Byte && wasm_i32_eq(this.toInt(), other.toInt())
public override fun hashCode(): Int = this.toInt()
public override fun hashCode(): Int =
this.toInt()
@WasmNoOpCast
@PublishedApi
@@ -744,7 +755,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Byte): IntRange = this until other
public operator fun rangeUntil(other: Byte): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -753,7 +765,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Short): IntRange = this until other
public operator fun rangeUntil(other: Short): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -762,7 +775,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Int): IntRange = this until other
public operator fun rangeUntil(other: Int): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -771,7 +785,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Long): LongRange = this until other
public operator fun rangeUntil(other: Long): LongRange =
this until other
/**
* Converts this [Short] value to [Byte].
@@ -782,7 +797,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
* The resulting `Byte` value is represented by the least significant 8 bits of this `Short` value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override inline fun toByte(): Byte = this.toInt().toByte()
public override inline fun toByte(): Byte =
this.toInt().toByte()
/**
* Converts this [Short] value to [Char].
@@ -793,7 +809,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
@Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()"))
@DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "2.3")
@kotlin.internal.IntrinsicConstEvaluation
public override fun toChar(): Char = reinterpretAsInt().reinterpretAsChar()
public override fun toChar(): Char =
reinterpretAsInt().reinterpretAsChar()
/** Returns this value. */
@kotlin.internal.IntrinsicConstEvaluation
@@ -809,7 +826,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
* whereas the most significant 16 bits are filled with the sign bit of this value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toInt(): Int = reinterpretAsInt()
public override fun toInt(): Int =
reinterpretAsInt()
/**
* Converts this [Short] value to [Long].
@@ -820,7 +838,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
* whereas the most significant 48 bits are filled with the sign bit of this value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toLong(): Long = wasm_i64_extend_i32_s(this.toInt())
public override fun toLong(): Long =
wasm_i64_extend_i32_s(this.toInt())
/**
* Converts this [Short] value to [Float].
@@ -828,7 +847,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
* The resulting `Float` value represents the same numerical value as this `Short`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toFloat(): Float = wasm_f32_convert_i32_s(this.toInt())
public override fun toFloat(): Float =
wasm_f32_convert_i32_s(this.toInt())
/**
* Converts this [Short] value to [Double].
@@ -836,7 +856,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
* The resulting `Double` value represents the same numerical value as this `Short`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toDouble(): Double = wasm_f64_convert_i32_s(this.toInt())
public override fun toDouble(): Double =
wasm_f64_convert_i32_s(this.toInt())
@kotlin.internal.IntrinsicConstEvaluation
public override fun toString(): String =
@@ -846,7 +867,8 @@ public class Short private constructor(private val value: Short) : Number(), Com
public override fun equals(other: Any?): Boolean =
other is Short && wasm_i32_eq(this.toInt(), other.toInt())
public override fun hashCode(): Int = this.toInt()
public override fun hashCode(): Int =
this.toInt()
@WasmNoOpCast
@PublishedApi
@@ -1169,7 +1191,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Byte): IntRange = this until other
public operator fun rangeUntil(other: Byte): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1178,7 +1201,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Short): IntRange = this until other
public operator fun rangeUntil(other: Short): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1187,7 +1211,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Int): IntRange = this until other
public operator fun rangeUntil(other: Int): IntRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1196,7 +1221,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Long): LongRange = this until other
public operator fun rangeUntil(other: Long): LongRange =
this until other
/**
* Shifts this value left by the [bitCount] number of bits.
@@ -1263,7 +1289,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
* The resulting `Byte` value is represented by the least significant 8 bits of this `Int` value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toByte(): Byte = ((this shl 24) shr 24).reinterpretAsByte()
public override fun toByte(): Byte =
((this shl 24) shr 24).reinterpretAsByte()
/**
* Converts this [Int] value to [Char].
@@ -1275,7 +1302,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
*/
@Suppress("OVERRIDE_DEPRECATION")
@kotlin.internal.IntrinsicConstEvaluation
public override fun toChar(): Char = (this and 0xFFFF).reinterpretAsChar()
public override fun toChar(): Char =
(this and 0xFFFF).reinterpretAsChar()
/**
* Converts this [Int] value to [Short].
@@ -1286,7 +1314,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
* The resulting `Short` value is represented by the least significant 16 bits of this `Int` value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toShort(): Short = ((this shl 16) shr 16).reinterpretAsShort()
public override fun toShort(): Short =
((this shl 16) shr 16).reinterpretAsShort()
/** Returns this value. */
@kotlin.internal.IntrinsicConstEvaluation
@@ -1302,7 +1331,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
* whereas the most significant 32 bits are filled with the sign bit of this value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toLong(): Long = wasm_i64_extend_i32_s(this)
public override fun toLong(): Long =
wasm_i64_extend_i32_s(this)
/**
* Converts this [Int] value to [Float].
@@ -1312,7 +1342,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
* the one with zero at least significant bit of mantissa is selected.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toFloat(): Float = wasm_f32_convert_i32_s(this)
public override fun toFloat(): Float =
wasm_f32_convert_i32_s(this)
/**
* Converts this [Int] value to [Double].
@@ -1320,7 +1351,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
* The resulting `Double` value represents the same numerical value as this `Int`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toDouble(): Double = wasm_f64_convert_i32_s(this)
public override fun toDouble(): Double =
wasm_f64_convert_i32_s(this)
@kotlin.internal.IntrinsicConstEvaluation
public override fun toString(): String =
@@ -1330,7 +1362,8 @@ public class Int private constructor(private val value: Int) : Number(), Compara
public override fun equals(other: Any?): Boolean =
other is Int && wasm_i32_eq(this, other)
public override fun hashCode(): Int = this
public override fun hashCode(): Int =
this
@WasmNoOpCast
@PublishedApi
@@ -1667,7 +1700,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Byte): LongRange = this until other
public operator fun rangeUntil(other: Byte): LongRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1676,7 +1710,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Short): LongRange = this until other
public operator fun rangeUntil(other: Short): LongRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1685,7 +1720,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Int): LongRange = this until other
public operator fun rangeUntil(other: Int): LongRange =
this until other
/**
* Creates a range from this value up to but excluding the specified [other] value.
@@ -1694,7 +1730,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
*/
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
public operator fun rangeUntil(other: Long): LongRange = this until other
public operator fun rangeUntil(other: Long): LongRange =
this until other
/**
* Shifts this value left by the [bitCount] number of bits.
@@ -1758,7 +1795,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
* The resulting `Byte` value is represented by the least significant 8 bits of this `Long` value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override inline fun toByte(): Byte = this.toInt().toByte()
public override inline fun toByte(): Byte =
this.toInt().toByte()
/**
* Converts this [Long] value to [Char].
@@ -1771,7 +1809,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
@Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()"))
@DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "2.3")
@kotlin.internal.IntrinsicConstEvaluation
public override inline fun toChar(): Char = this.toInt().toChar()
public override inline fun toChar(): Char =
this.toInt().toChar()
/**
* Converts this [Long] value to [Short].
@@ -1782,7 +1821,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
* The resulting `Short` value is represented by the least significant 16 bits of this `Long` value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override inline fun toShort(): Short = this.toInt().toShort()
public override inline fun toShort(): Short =
this.toInt().toShort()
/**
* Converts this [Long] value to [Int].
@@ -1793,7 +1833,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
* The resulting `Int` value is represented by the least significant 32 bits of this `Long` value.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toInt(): Int = wasm_i32_wrap_i64(this)
public override fun toInt(): Int =
wasm_i32_wrap_i64(this)
/** Returns this value. */
@kotlin.internal.IntrinsicConstEvaluation
@@ -1808,7 +1849,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
* the one with zero at least significant bit of mantissa is selected.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toFloat(): Float = wasm_f32_convert_i64_s(this)
public override fun toFloat(): Float =
wasm_f32_convert_i64_s(this)
/**
* Converts this [Long] value to [Double].
@@ -1818,7 +1860,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
* the one with zero at least significant bit of mantissa is selected.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toDouble(): Double = wasm_f64_convert_i64_s(this)
public override fun toDouble(): Double =
wasm_f64_convert_i64_s(this)
@kotlin.internal.IntrinsicConstEvaluation
public override fun toString(): String =
@@ -1828,7 +1871,8 @@ public class Long private constructor(private val value: Long) : Number(), Compa
public override fun equals(other: Any?): Boolean =
other is Long && wasm_i64_eq(this, other)
public override fun hashCode(): Int = ((this ushr 32) xor this).toInt()
public override fun hashCode(): Int =
((this ushr 32) xor this).toInt()
}
/** Represents a single-precision 32-bit IEEE 754 floating point number. */
@@ -2158,7 +2202,8 @@ public class Float private constructor(private val value: Float) : Number(), Com
@Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", ReplaceWith("toInt().toByte()"))
@DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.5")
@kotlin.internal.IntrinsicConstEvaluation
public override inline fun toByte(): Byte = this.toInt().toByte()
public override inline fun toByte(): Byte =
this.toInt().toByte()
/**
* Converts this [Float] value to [Char].
@@ -2168,7 +2213,8 @@ public class Float private constructor(private val value: Float) : Number(), Com
@Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()"))
@DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "2.3")
@kotlin.internal.IntrinsicConstEvaluation
public override inline fun toChar(): Char = this.toInt().toChar()
public override inline fun toChar(): Char =
this.toInt().toChar()
/**
* Converts this [Float] value to [Short].
@@ -2178,7 +2224,8 @@ public class Float private constructor(private val value: Float) : Number(), Com
@Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", ReplaceWith("toInt().toShort()"))
@DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.5")
@kotlin.internal.IntrinsicConstEvaluation
public override inline fun toShort(): Short = this.toInt().toShort()
public override inline fun toShort(): Short =
this.toInt().toShort()
/**
* Converts this [Float] value to [Int].
@@ -2188,7 +2235,8 @@ public class Float private constructor(private val value: Float) : Number(), Com
* [Int.MAX_VALUE] if it's bigger than `Int.MAX_VALUE`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toInt(): Int = wasm_i32_trunc_sat_f32_s(this)
public override fun toInt(): Int =
wasm_i32_trunc_sat_f32_s(this)
/**
* Converts this [Float] value to [Long].
@@ -2198,7 +2246,8 @@ public class Float private constructor(private val value: Float) : Number(), Com
* [Long.MAX_VALUE] if it's bigger than `Long.MAX_VALUE`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toLong(): Long = wasm_i64_trunc_sat_f32_s(this)
public override fun toLong(): Long =
wasm_i64_trunc_sat_f32_s(this)
/** Returns this value. */
@kotlin.internal.IntrinsicConstEvaluation
@@ -2211,7 +2260,8 @@ public class Float private constructor(private val value: Float) : Number(), Com
* The resulting `Double` value represents the same numerical value as this `Float`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toDouble(): Double = wasm_f64_promote_f32(this)
public override fun toDouble(): Double =
wasm_f64_promote_f32(this)
@kotlin.internal.IntrinsicConstEvaluation
public override fun toString(): String =
@@ -2221,7 +2271,8 @@ public class Float private constructor(private val value: Float) : Number(), Com
public override fun equals(other: Any?): Boolean =
other is Float && this.toBits() == other.toBits()
public override fun hashCode(): Int = toBits()
public override fun hashCode(): Int =
toBits()
}
/** Represents a double-precision 64-bit IEEE 754 floating point number. */
@@ -2551,7 +2602,8 @@ public class Double private constructor(private val value: Double) : Number(), C
@Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", ReplaceWith("toInt().toByte()"))
@DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.5")
@kotlin.internal.IntrinsicConstEvaluation
public override inline fun toByte(): Byte = this.toInt().toByte()
public override inline fun toByte(): Byte =
this.toInt().toByte()
/**
* Converts this [Double] value to [Char].
@@ -2561,7 +2613,8 @@ public class Double private constructor(private val value: Double) : Number(), C
@Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()"))
@DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "2.3")
@kotlin.internal.IntrinsicConstEvaluation
public override inline fun toChar(): Char = this.toInt().toChar()
public override inline fun toChar(): Char =
this.toInt().toChar()
/**
* Converts this [Double] value to [Short].
@@ -2571,7 +2624,8 @@ public class Double private constructor(private val value: Double) : Number(), C
@Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", ReplaceWith("toInt().toShort()"))
@DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.5")
@kotlin.internal.IntrinsicConstEvaluation
public override inline fun toShort(): Short = this.toInt().toShort()
public override inline fun toShort(): Short =
this.toInt().toShort()
/**
* Converts this [Double] value to [Int].
@@ -2581,7 +2635,8 @@ public class Double private constructor(private val value: Double) : Number(), C
* [Int.MAX_VALUE] if it's bigger than `Int.MAX_VALUE`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toInt(): Int = wasm_i32_trunc_sat_f64_s(this)
public override fun toInt(): Int =
wasm_i32_trunc_sat_f64_s(this)
/**
* Converts this [Double] value to [Long].
@@ -2591,7 +2646,8 @@ public class Double private constructor(private val value: Double) : Number(), C
* [Long.MAX_VALUE] if it's bigger than `Long.MAX_VALUE`.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toLong(): Long = wasm_i64_trunc_sat_f64_s(this)
public override fun toLong(): Long =
wasm_i64_trunc_sat_f64_s(this)
/**
* Converts this [Double] value to [Float].
@@ -2601,7 +2657,8 @@ public class Double private constructor(private val value: Double) : Number(), C
* the one with zero at least significant bit of mantissa is selected.
*/
@kotlin.internal.IntrinsicConstEvaluation
public override fun toFloat(): Float = wasm_f32_demote_f64(this)
public override fun toFloat(): Float =
wasm_f32_demote_f64(this)
/** Returns this value. */
@kotlin.internal.IntrinsicConstEvaluation
@@ -2616,5 +2673,6 @@ public class Double private constructor(private val value: Double) : Number(), C
public override fun equals(other: Any?): Boolean =
other is Double && this.toBits() == other.toBits()
public override fun hashCode(): Int = toBits().hashCode()
public override fun hashCode(): Int =
toBits().hashCode()
}