汇编中imul_JavaScript中带有示例的Math.imul()方法

汇编中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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值