multiplyExact(x: Long, y: Long)
is a function in the math package of Scala. The function returns the product of the numbers passed in as arguments.
def multiplyExact(x: Long, y: Long): Long
The function takes two parameters: x
and y
. The parameters are of type Long
.
The function returns *.
The function throws ArithmeticException if the
Long
is overflowed by the return value.
object MainObject {def main(args: Array[String]) {var x : Long = 31;var y : Long = 22;println("Math.multiplyExact(x, y) = " + Math.multiplyExact(x, y));}}