本文共 1223 字,大约阅读时间需要 4 分钟。
汇编中imul
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
输出量
4012-10240-81
Example 2: With strings
示例2:带字符串
console.log(Math.imul("Javascript"));console.log(Math.imul("Javascript", "C++"));
Output
输出量
00
翻译自:
汇编中imul
转载地址:http://bsxzd.baihongyu.com/