ฟังก์ชัน imul() ของออบเจ็กต์ Math จะรับตัวเลขสองตัวและคืนค่าผลคูณแบบ 32-bit แบบ C ของตัวเลขที่ให้มา
ไวยากรณ์
รูปแบบการใช้งานคือดังนี้
Math.imul(47, 56);
ตัวอย่าง
<html> <head> <title>ตัวอย่าง JavaScript</title> </head> <body> <script type="text/javascript"> var result = Math.imul(47, 56); document.write("ผลลัพธ์: "+result); </script> </body> </html>ผลลัพธ์
ผลลัพธ์: 2632