About stdlib...
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, wellwritten, studied, documented, tested, measured, and highquality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
imul
Perform Clike multiplication of two signed 32bit integers.
Installation
npm install @stdlib/mathbaseopsimul
Usage
var imul = require( '@stdlib/mathbaseopsimul' );
imul( a, b )
Performs Clike multiplication of two signed 32bit integers.
var v = imul( 100, 40 );
// returns 40
v = imul( 10737418240, 50 ); // 2^30 * 5 = 5368709120 => 32bit integer overflow
// returns 1073741824
Notes
 The function emulates Clike multiplication of two signed 32bit integers.
Examples
var discreteUniform = require( '@stdlib/randombasediscreteuniform' ).factory;
var INT32_MIN = require( '@stdlib/constantsint32min' );
var INT32_MAX = require( '@stdlib/constantsint32max' );
var imul = require( '@stdlib/mathbaseopsimul' );
var randi;
var a;
var b;
var y;
var i;
randi = discreteUniform( INT32_MIN, INT32_MAX );
for ( i = 0; i < 100; i++ ) {
a = randi()0;
b = randi()0;
y = imul( a, b );
console.log( '%d x %d = %d', a, b, y );
}
See Also

@stdlib/mathbase/ops/imuldw
: compute the double word product of two signed 32bit integers.
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 20162024. The Stdlib Authors.