Add intrinsic for ULong/UInt.toString on Java 8+
Unfortunately this cannot currently be done for the extension overload which accepts a radix due to behavior difference with regard to invalid radix values.
This commit is contained in:
committed by
max-kammerer
parent
b7917978b8
commit
4386518c4d
@@ -0,0 +1,15 @@
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun box(): String {
|
||||
val min = 0U.toString()
|
||||
if ("0" != min) throw AssertionError(min)
|
||||
|
||||
val middle = 2_147_483_647U.toString()
|
||||
if ("2147483647" != middle) throw AssertionError(middle)
|
||||
|
||||
val max = 4_294_967_295U.toString()
|
||||
if ("4294967295" != max) throw AssertionError(max)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun box(): String {
|
||||
val min = 0UL.toString()
|
||||
if ("0" != min) throw AssertionError(min)
|
||||
|
||||
val middle = 9_223_372_036_854_775_807UL.toString()
|
||||
if ("9223372036854775807" != middle) throw AssertionError(middle)
|
||||
|
||||
val max = 18_446_744_073_709_551_615UL.toString()
|
||||
if ("18446744073709551615" != max) throw AssertionError(max)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user