addExact

open fun addExact(x: Int, y: Int): Int(source)

Returns the sum of its arguments, throwing an exception if the result overflows an int.

Return

the result

Parameters

x

the first value

y

the second value

Throws

if the result overflows an int


open fun addExact(x: Long, y: Long): Long(source)

Returns the sum of its arguments, throwing an exception if the result overflows a long.

Return

the result

Parameters

x

the first value

y

the second value

Throws

if the result overflows a long