Math.imul() 函式在 JavaScript 中


Math 物件的 imul() 函式接受兩個數字,並返回給定數字的 C 語言風格的 32 位乘法的結果。

語法

其語法如下

Math.imul(47, 56);

示例

 現場演示

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var result = Math.imul(47, 56);
      document.write("Result: "+result);
   </script>
</body>
</html>

輸出

Result: 2632

更新於: 2020 年 6 月 25 日

71 次檢視

開啟你的 職業生涯

透過完成課程獲得認證

開始
廣告
© . All rights reserved.