
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
What is the use of Math.imul( ) Function in JavaScript?
Math.imul( )
Unlike other multiplying functions, the Math.imul() function returns the result of the C-like 32-bit multiplication of the two parameters. Its application is very high in projects like Emscripten.
syntax
var product = Math.imul(a, b);
This method takes two numbers and gives out their multiplication value.
Example-1
In the following example, two normal integers were given as parameters to the method Math.Imul() and the obtained result is displayed as shown in the output.
<html> <body> <script> document.write(Math.imul(3, 4)); document.write("</br>"); document.write(Math.imul(-3, 4)); </script> </body> </html>
Output
12 -12
Example-2
In the following example, c-like 32-bit values were given as parameters to the method Math.Imul() and the obtained result is displayed as shown in the output
<html> <body> <script> document.write(Math.imul(0xffffffff, 4)); document.write("</br>"); document.write(Math.imul(0xfffffffe, 4)); </script> </body> </html>
Output
-4 -8
- Related Articles
- Math.imul() function in JavaScript
- What is the use of apply() function in JavaScript?
- What is the use of Math.hypot() function in JavaScript?
- What is the use of JavaScript eval function?
- What is the use of return statement inside a function in JavaScript?
- What is the use of ()(parenthesis) brackets in accessing a function in JavaScript?
- What is the use of FIND_IN_SET () function in MySQL?
- What is the use of LOCATE() function in MySQL?
- What is the use of pheatmap function in R?
- What is the use of the map function in Python?
- What is the use of Atomics in JavaScript?
- What is the use of OBJECT.assign() in javascript?
- What is the use of Map in JavaScript?
- What is the use of window.location in javascript?
- What is the use of sentry in javascript?

Advertisements