Skip to content

Commit 1994f2e

Browse files
Merge branch 'stdlib-js:develop' into Add-C-implementations-to-base-special-math-functions
2 parents 08dbcdc + b688f77 commit 1994f2e

File tree

133 files changed

+4732
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+4732
-253
lines changed
Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
{
2-
"E": "@stdlib/constants/float64/e",
3-
"LN2": "@stdlib/constants/float64/ln-two",
4-
"LN10": "@stdlib/constants/float64/ln-ten",
5-
"LOG2E": "@stdlib/constants/float64/log2-e",
6-
"LOG10E": "@stdlib/constants/float64/log10-e",
7-
"PI": "@stdlib/constants/float64/pi",
8-
"SQRT1_2": "@stdlib/constants/float64/sqrt-half",
9-
"SQRT2": "@stdlib/constants/float64/sqrt-two",
10-
"abs": "@stdlib/math/base/special/abs",
11-
"acos": "@stdlib/math/base/special/acos",
12-
"acosh": "@stdlib/math/base/special/acosh",
13-
"asin": "@stdlib/math/base/special/asin",
14-
"asinh": "@stdlib/math/base/special/asinh",
15-
"atan": "@stdlib/math/base/special/atan",
16-
"atanh": "@stdlib/math/base/special/atanh",
17-
"atan2": "@stdlib/math/base/special/atan2",
18-
"cbrt": "@stdlib/math/base/special/cbrt",
19-
"ceil": "@stdlib/math/base/special/ceil",
20-
"cos": "@stdlib/math/base/special/cos",
21-
"cosh": "@stdlib/math/base/special/cosh",
22-
"exp": "@stdlib/math/base/special/exp",
23-
"expm1": "@stdlib/math/base/special/expm1",
24-
"floor": "@stdlib/math/base/special/floor",
25-
"fround": "@stdlib/number/float64/base/to-float32",
26-
"hypot": "@stdlib/math/base/special/hypot",
27-
"imul": "@stdlib/math/base/ops/imul",
28-
"log": "@stdlib/math/base/special/ln",
29-
"log1p": "@stdlib/math/base/special/log1p",
30-
"log10": "@stdlib/math/base/special/log10",
31-
"log2": "@stdlib/math/base/special/log2",
32-
"max": "@stdlib/math/base/special/max",
33-
"min": "@stdlib/math/base/special/min",
34-
"pow": "@stdlib/math/base/special/pow",
35-
"random": "@stdlib/random/base/randu",
36-
"round": "@stdlib/math/base/special/round",
37-
"sign": "@stdlib/math/base/special/signum",
38-
"sin": "@stdlib/math/base/special/sin",
39-
"sinh": "@stdlib/math/base/special/sinh",
40-
"sqrt": "@stdlib/math/base/special/sqrt",
41-
"tan": "@stdlib/math/base/special/tan",
42-
"tanh": "@stdlib/math/base/special/tanh",
43-
"trunc": "@stdlib/math/base/special/trunc"
2+
"E": "@stdlib/constants/float64/e",
3+
"LN2": "@stdlib/constants/float64/ln-two",
4+
"LN10": "@stdlib/constants/float64/ln-ten",
5+
"LOG2E": "@stdlib/constants/float64/log2-e",
6+
"LOG10E": "@stdlib/constants/float64/log10-e",
7+
"PI": "@stdlib/constants/float64/pi",
8+
"SQRT1_2": "@stdlib/constants/float64/sqrt-half",
9+
"SQRT2": "@stdlib/constants/float64/sqrt-two",
10+
"abs": "@stdlib/math/base/special/abs",
11+
"acos": "@stdlib/math/base/special/acos",
12+
"acosh": "@stdlib/math/base/special/acosh",
13+
"asin": "@stdlib/math/base/special/asin",
14+
"asinh": "@stdlib/math/base/special/asinh",
15+
"atan": "@stdlib/math/base/special/atan",
16+
"atanh": "@stdlib/math/base/special/atanh",
17+
"atan2": "@stdlib/math/base/special/atan2",
18+
"cbrt": "@stdlib/math/base/special/cbrt",
19+
"ceil": "@stdlib/math/base/special/ceil",
20+
"cos": "@stdlib/math/base/special/cos",
21+
"cosh": "@stdlib/math/base/special/cosh",
22+
"exp": "@stdlib/math/base/special/exp",
23+
"expm1": "@stdlib/math/base/special/expm1",
24+
"floor": "@stdlib/math/base/special/floor",
25+
"fround": "@stdlib/number/float64/base/to-float32",
26+
"hypot": "@stdlib/math/base/special/hypot",
27+
"imul": "@stdlib/number/int32/base/mul",
28+
"log": "@stdlib/math/base/special/ln",
29+
"log1p": "@stdlib/math/base/special/log1p",
30+
"log10": "@stdlib/math/base/special/log10",
31+
"log2": "@stdlib/math/base/special/log2",
32+
"max": "@stdlib/math/base/special/max",
33+
"min": "@stdlib/math/base/special/min",
34+
"pow": "@stdlib/math/base/special/pow",
35+
"random": "@stdlib/random/base/randu",
36+
"round": "@stdlib/math/base/special/round",
37+
"sign": "@stdlib/math/base/special/signum",
38+
"sin": "@stdlib/math/base/special/sin",
39+
"sinh": "@stdlib/math/base/special/sinh",
40+
"sqrt": "@stdlib/math/base/special/sqrt",
41+
"tan": "@stdlib/math/base/special/tan",
42+
"tanh": "@stdlib/math/base/special/tanh",
43+
"trunc": "@stdlib/math/base/special/trunc"
4444
}

lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-math/test/fixtures/invalid.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
'use strict';
2020

2121
var invalid = [];
22-
var test;
2322

24-
test = {
23+
var test = {
2524
'code': [
2625
'// VARIABLES //',
2726
'',
@@ -91,6 +90,21 @@ test = {
9190
};
9291
invalid.push( test );
9392

93+
test = {
94+
'code': [
95+
'// VARIABLES //',
96+
'',
97+
'var out = Math.imul( -5, 12 );'
98+
].join( '\n' ),
99+
'errors': [
100+
{
101+
'message': 'Use the package `@stdlib/number/int32/base/mul` instead of `Math.imul`',
102+
'type': 'MemberExpression'
103+
}
104+
]
105+
};
106+
invalid.push( test );
107+
94108

95109
// EXPORTS //
96110

lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-math/test/fixtures/unvalidated.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
'use strict';
2020

2121
var valid = [];
22-
var test;
2322

24-
test = {
23+
var test = {
2524
'code': [
2625
'// VARIABLES //',
2726
'',

lib/node_modules/@stdlib/_tools/eslint/rules/no-builtin-math/test/fixtures/valid.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
'use strict';
2020

2121
var valid = [];
22-
var test;
2322

24-
test = {
23+
var test = {
2524
'code': [
2625
'// VARIABLES //',
2726
'',
@@ -52,7 +51,7 @@ test = {
5251
'code': [
5352
'// VARIABLES //',
5453
'',
55-
'var out = Math.imul( -5, 12 );' // TODO: remove once an equivalent to `Math.imul` is present in the project
54+
'var out = imul( -5, 12 );'
5655
].join( '\n' )
5756
};
5857
valid.push( test );

lib/node_modules/@stdlib/array/filled/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function filledAccessors( arr, value ) {
100100
* @throws {TypeError} must provide a recognized data type
101101
* @throws {TypeError} must provide a length, typed array, array-like object, buffer, or iterable
102102
* @throws {Error} creating a generic array from an `ArrayBuffer` is not supported
103-
* @returns {(TypedArray|Array|ComplexArray)} array or typed array
103+
* @returns {(TypedArray|Array|Complex64Array)} array or typed array
104104
*
105105
* @example
106106
* var arr = filledarray();

lib/node_modules/@stdlib/constants/float32/sqrt-half/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ Macro for the [square root][@stdlib/math/base/special/sqrtf] of `1/2` as a singl
120120

121121
<section class="related">
122122

123+
* * *
124+
125+
## See Also
126+
127+
- <span class="package-name">[`@stdlib/constants/float64/sqrt-half`][@stdlib/constants/float64/sqrt-half]</span><span class="delimiter">: </span><span class="description">square root of 1/2.</span>
128+
123129
</section>
124130

125131
<!-- /.related -->
@@ -132,6 +138,8 @@ Macro for the [square root][@stdlib/math/base/special/sqrtf] of `1/2` as a singl
132138

133139
<!-- <related-links> -->
134140

141+
[@stdlib/constants/float64/sqrt-half]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/float64/sqrt-half
142+
135143
<!-- </related-links> -->
136144

137145
</section>

lib/node_modules/@stdlib/math/base/ops/README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The namespace contains the following functions:
5050
- <span class="signature">[`cnegf( z )`][@stdlib/math/base/ops/cnegf]</span><span class="delimiter">: </span><span class="description">negate a single-precision complex floating-point number.</span>
5151
- <span class="signature">[`csub( z1, z2 )`][@stdlib/math/base/ops/csub]</span><span class="delimiter">: </span><span class="description">subtract two double-precision complex floating-point numbers.</span>
5252
- <span class="signature">[`csubf( z1, z2 )`][@stdlib/math/base/ops/csubf]</span><span class="delimiter">: </span><span class="description">subtract two single-precision complex floating-point numbers.</span>
53-
- <span class="signature">[`imul( a, b )`][@stdlib/math/base/ops/imul]</span><span class="delimiter">: </span><span class="description">perform C-like multiplication of two signed 32-bit integers.</span>
53+
- <span class="signature">[`imul( a, b )`][@stdlib/number/int32/base/mul]</span><span class="delimiter">: </span><span class="description">perform C-like multiplication of two signed 32-bit integers.</span>
5454
- <span class="signature">[`imuldw( a, b )`][@stdlib/math/base/ops/imuldw]</span><span class="delimiter">: </span><span class="description">compute the double word product of two signed 32-bit integers.</span>
5555
- <span class="signature">[`umuldw( a, b )`][@stdlib/math/base/ops/umuldw]</span><span class="delimiter">: </span><span class="description">compute the double word product of two unsigned 32-bit integers.</span>
5656

@@ -86,11 +86,6 @@ var z2 = new Complex128( -2.0, 1.0 );
8686
console.log( ns.cmul( z1, z2 ) ); // { 're': -13.0, 'im': -1.0 }
8787
// => <Complex128>
8888

89-
// Operations for signed 32-bit integers:
90-
// 2^30 * -5 = -5368709120 => 32-bit integer overflow
91-
console.log( ns.imul( 1073741824|0, -5|0 ) );
92-
// => -1073741824
93-
9489
// Operations for double word product:
9590
// -(2^31) * 2^30 = -2305843009213694000 => 32-bit integer overflow
9691
console.log( ns.imuldw( 0x80000000|0, 0x40000000|0 ) );
@@ -125,7 +120,7 @@ console.log( ns.imuldw( 0x80000000|0, 0x40000000|0 ) );
125120

126121
[@stdlib/math/base/ops/csubf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/ops/csubf
127122

128-
[@stdlib/math/base/ops/imul]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/ops/imul
123+
[@stdlib/number/int32/base/mul]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/number/int32/base/mul
129124

130125
[@stdlib/math/base/ops/imuldw]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/ops/imuldw
131126

lib/node_modules/@stdlib/math/base/ops/docs/types/index.d.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ import cneg = require( '@stdlib/math/base/ops/cneg' );
2929
import cnegf = require( '@stdlib/math/base/ops/cnegf' );
3030
import csub = require( '@stdlib/math/base/ops/csub' );
3131
import csubf = require( '@stdlib/math/base/ops/csubf' );
32-
import imul = require( '@stdlib/math/base/ops/imul' );
3332
import imuldw = require( '@stdlib/math/base/ops/imuldw' );
3433
import umuldw = require( '@stdlib/math/base/ops/umuldw' );
35-
import addf = require( '@stdlib/number/float32/base/add' );
3634
import divf = require( '@stdlib/number/float32/base/div' );
3735
import div = require( '@stdlib/number/float64/base/div' );
3836
import mul = require( '@stdlib/number/float64/base/mul' );
@@ -414,19 +412,6 @@ interface Namespace {
414412
*/
415413
csubf: typeof csubf;
416414

417-
/**
418-
* Performs C-like multiplication of two signed 32-bit integers.
419-
*
420-
* @param a - signed 32-bit integer
421-
* @param b - signed 32-bit integer
422-
* @returns product
423-
*
424-
* @example
425-
* var v = ns.imul( -10|0, 4|0 );
426-
* // returns -40
427-
*/
428-
imul: typeof imul;
429-
430415
/**
431416
* Performs multiplication of two signed 32-bit integers and returns an array of two signed 32-bit integers which represents the signed 64-bit integer product.
432417
*
@@ -461,35 +446,6 @@ interface Namespace {
461446
*/
462447
umuldw: typeof umuldw;
463448

464-
/**
465-
* Computes the sum of two single-precision floating-point numbers `x` and `y`.
466-
*
467-
* @param x - first input value
468-
* @param y - second input value
469-
* @returns sum
470-
*
471-
* @example
472-
* var v = ns.addf( -1.0, 5.0 );
473-
* // returns 4.0
474-
*
475-
* @example
476-
* var v = ns.addf( 2.0, 5.0 );
477-
* // returns 7.0
478-
*
479-
* @example
480-
* var v = ns.addf( 0.0, 5.0 );
481-
* // returns 5.0
482-
*
483-
* @example
484-
* var v = ns.addf( -0.0, 0.0 );
485-
* // returns 0.0
486-
*
487-
* @example
488-
* var v = ns.addf( NaN, NaN );
489-
* // returns NaN
490-
*/
491-
addf: typeof addf;
492-
493449
/**
494450
* Divides two single-precision floating-point numbers `x` and `y`.
495451
*

lib/node_modules/@stdlib/math/base/ops/imuldw/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ for ( i = 0x7FFFFFF0; i < 0x7FFFFFFF; i++ ) {
110110

111111
## See Also
112112

113-
- <span class="package-name">[`@stdlib/math/base/ops/imul`][@stdlib/math/base/ops/imul]</span><span class="delimiter">: </span><span class="description">perform C-like multiplication of two signed 32-bit integers.</span>
113+
- <span class="package-name">[`@stdlib/number/int32/base/mul`][@stdlib/number/int32/base/mul]</span><span class="delimiter">: </span><span class="description">perform C-like multiplication of two signed 32-bit integers.</span>
114114

115115
</section>
116116

@@ -124,7 +124,7 @@ for ( i = 0x7FFFFFF0; i < 0x7FFFFFFF; i++ ) {
124124

125125
<!-- <related-links> -->
126126

127-
[@stdlib/math/base/ops/imul]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/ops/imul
127+
[@stdlib/number/int32/base/mul]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/number/int32/base/mul
128128

129129
<!-- </related-links> -->
130130

lib/node_modules/@stdlib/math/base/ops/lib/index.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,6 @@ setReadOnly( ns, 'csub', require( '@stdlib/math/base/ops/csub' ) );
117117
*/
118118
setReadOnly( ns, 'csubf', require( '@stdlib/math/base/ops/csubf' ) );
119119

120-
/**
121-
* @name imul
122-
* @memberof ns
123-
* @readonly
124-
* @type {Function}
125-
* @see {@link module:@stdlib/math/base/ops/imul}
126-
*/
127-
setReadOnly( ns, 'imul', require( '@stdlib/math/base/ops/imul' ) );
128-
129120
/**
130121
* @name imuldw
131122
* @memberof ns
@@ -144,15 +135,6 @@ setReadOnly( ns, 'imuldw', require( '@stdlib/math/base/ops/imuldw' ) );
144135
*/
145136
setReadOnly( ns, 'umuldw', require( '@stdlib/math/base/ops/umuldw' ) );
146137

147-
/**
148-
* @name addf
149-
* @memberof ns
150-
* @readonly
151-
* @type {Function}
152-
* @see {@link module:@stdlib/number/float32/base/add}
153-
*/
154-
setReadOnly( ns, 'addf', require( '@stdlib/number/float32/base/add' ) );
155-
156138
/**
157139
* @name divf
158140
* @memberof ns

0 commit comments

Comments
 (0)