Parameters or Arguments
number1 The first range to multiply. number2 The 2d quantity to multiply.
The imul() feature returns the result of two values that are improved together the usage of 32-bit multiplication.
Math is a placeholder object that incorporates mathematical functions and constants of which imul() is one of these functions.
console.log(Math.imul(2, 5)); console.log(Math.imul(-18, 6));
In this example, we have invoked the imul() function using the Math class.
We have written the output of the imul() characteristic to the net browser console log, for demonstration purposes, to exhibit what the imul() feature returns.
The following will be output to the net browser console log:
In this example, the first output to the console log returned 10 which is the result of two extended by 5 the usage of 32-bit multiplication.
The 2d output to the console log back -108 which is the result of -18 extended by way of 6 the usage of 32-bit multiplication.