diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 0201b349a85..4bf0c195be3 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -2230,10 +2230,9 @@ task hash0(type: KonanLocalTest) { } task ieee754(type: KonanLocalTest) { - goldValue = "Infinity 2147483647 -1 -1\n" + + goldValue = "Infinity 2147483647 -1\n" + "3.4028235E38\n" + "NAN2SHORT:: 0\n" + - "MAX2SHORT:: -1\n" + "2147483647 -1\n" + "FLOAT:: Infinity INT:: 2147483647\n" + "FLOAT:: 1.7014117E38 INT:: 2147483647\n" + diff --git a/kotlin-native/backend.native/tests/runtime/basic/ieee754.kt b/kotlin-native/backend.native/tests/runtime/basic/ieee754.kt index c836dae690b..c25d02b5121 100644 --- a/kotlin-native/backend.native/tests/runtime/basic/ieee754.kt +++ b/kotlin-native/backend.native/tests/runtime/basic/ieee754.kt @@ -10,17 +10,16 @@ import kotlin.test.* @Test fun runTest() { val v = Float.POSITIVE_INFINITY val i = v.toInt() - println("$v $i ${v.toShort()} ${i.toShort()}") + println("$v $i ${i.toShort()}") val a = 42 val b = Float.MAX_VALUE println("${a + b}") - val s = Float.NaN.toShort() + val s = Float.NaN.toInt().toShort() println("NAN2SHORT:: $s") val d: Float = Float.MAX_VALUE - println("MAX2SHORT:: ${d.toShort()}") val d2i = d.toInt() println("$d2i ${d2i.toShort()}") diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/Primitives.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/Primitives.kt index ae1473f6da0..4c9f239532e 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/Primitives.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/Primitives.kt @@ -1347,6 +1347,7 @@ public final class Float private constructor() : Number(), Comparable { * The resulting `Byte` value is equal to `this.toInt().toByte()`. */ @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") public override fun toByte(): Byte = this.toInt().toByte() /** @@ -1362,6 +1363,7 @@ public final class Float private constructor() : Number(), Comparable { * The resulting `Short` value is equal to `this.toInt().toShort()`. */ @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") public override fun toShort(): Short = this.toInt().toShort() /** @@ -1621,6 +1623,7 @@ public final class Double private constructor() : Number(), Comparable { * The resulting `Byte` value is equal to `this.toInt().toByte()`. */ @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") public override fun toByte(): Byte = this.toInt().toByte() /** @@ -1636,6 +1639,7 @@ public final class Double private constructor() : Number(), Comparable { * The resulting `Short` value is equal to `this.toInt().toShort()`. */ @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") public override fun toShort(): Short = this.toInt().toShort() /**