mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
11 lines
301 B
Kotlin
Vendored
11 lines
301 B
Kotlin
Vendored
fun box(): String {
|
|
val i1: Int = Int.MAX_VALUE
|
|
val i2 = i1 + 1
|
|
if (i2 > i1) return "fail: Int.MAX_VALUE + 1 should overflow to negative."
|
|
|
|
val i3: Int = Int.MIN_VALUE
|
|
val i4 = i3 - 1
|
|
if (i4 < i3) return "fail: Int.MIN_VALUE - 1 should overflow to positive."
|
|
|
|
return "OK"
|
|
} |