What is decrementExact(x: Int) in Scala?
decrementExact(x: Int) is a function in the Math package of Scala that decreases the argument by 1 and returns it.
Syntax
def decrementExact(x: Int): Int
Parameters
The function takes in one parameter, x, of type int.
Return value
The decrementExact() function returns the value of x decreased by 1, i.e., .
The function throws
ArithmeticExceptionifintis overflowed by the return value.
Code
object MainObject {def main(args: Array[String]): Unit = {var x : Int = 130;println("Math.decrementExact(x) = " + Math.decrementExact(x));}}