匯編中imul
JavaScript | Math.imul()方法 (JavaScript | Math.imul() Method)
Math.imul() is a function in math library of JavaScript that is used to the 32-bit multiplication of the two values passed to it. It uses C-like semantics to find the multiplication. It can accept floating-point variables but will convert it into integer before conversion.
Math.imul()是JavaScript數學庫中的函數,用于對傳遞給它的兩個值進行32位乘法。 它使用類似于C的語義來查找乘法。 它可以接受浮點變量,但會在轉換前將其轉換為整數。
Syntax:
句法:
Math.imul(val1, val2);
Parameter(s):
參數:
val1, val2 – represent the values that are to be multiplied using 32-bit multiplication.
val1,val2 –表示要使用32位乘法相乘的值。
Return value:
返回值:
The return type of this method is number, it returns the 32-bit multiplication.
該方法的返回類型為number ,它返回32位乘法。
Browser support: Chrome, Internet explorer, Mozilla, Safari, Opera mini.
瀏覽器支持: Chrome,Internet Explorer,Mozilla,Safari,Opera mini。
Example 1: Valid values
示例1:有效值
console.log(Math.imul(8, 5));
console.log(Math.imul(6.4, 2.1));
console.log(Math.imul(-32, 32));
console.log(Math.imul(0, 23));
console.log(Math.imul("27.08", "-3"));
Output
輸出量
40
12
-1024
0
-81
Example 2: With strings
示例2:帶字符串
console.log(Math.imul("Javascript"));
console.log(Math.imul("Javascript", "C++"));
Output
輸出量
0
0
翻譯自: https://www.includehelp.com/code-snippets/math-imul-method-with-example-in-javascript.aspx
匯編中imul