subtractExact

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

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

Return

the result

Parameters

x

the first value

y

the second value to subtract from the first

Throws

if the result overflows an int


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

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

Return

the result

Parameters

x

the first value

y

the second value to subtract from the first

Throws

if the result overflows a long