negateExact

open fun negateExact(a: Int): Int(source)

Returns the negation of the argument, throwing an exception if the result overflows an int. The overflow only occurs for the minimum value.

Return

the result

Parameters

a

the value to negate

Throws

if the result overflows an int


open fun negateExact(a: Long): Long(source)

Returns the negation of the argument, throwing an exception if the result overflows a long. The overflow only occurs for the minimum value.

Return

the result

Parameters

a

the value to negate

Throws

if the result overflows a long