import java.math.BigDecimal import kotlin.math.abs // C-dəki ub.c ilə müqayisə: JVM-də overflow həmişə wrap edir fun check(x: Int) = x + 1 > x fun main() { println("check(Int.MAX_VALUE) = ${check(Int.MAX_VALUE)}") try { Math.addExact(Int.MAX_VALUE, 1) } catch (e: ArithmeticException) { println("addExact: ${e.message}") } val h = "polygenelubricants".hashCode() println("hash = $h, abs(h) % 10 = ${abs(h) % 10}, floorMod = ${Math.floorMod(h, 10)}, h.mod(10) = ${h.mod(10)}") println("UInt.MAX_VALUE + 1u = ${UInt.MAX_VALUE + 1u}") println("(100 + 50).toByte() = ${(100 + 50).toByte()}") println("BigDecimal(0.1) = ${BigDecimal(0.1)}") println("BigDecimal of text 0.1 = " + BigDecimal("0.1")) }