Skip to content

Commit 8b496b2

Browse files
committed
Use constant packages
1 parent 2485ef5 commit 8b496b2

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

lib/node_modules/@stdlib/math/base/special/pow/lib/main.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var setLowWord = require( '@stdlib/number/float64/base/set-low-word' );
4545
var uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' );
4646
var NINF = require( '@stdlib/constants/float64/ninf' );
4747
var PINF = require( '@stdlib/constants/float64/pinf' );
48+
var ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' );
4849
var xIsZero = require( './x_is_zero.js' );
4950
var yIsHuge = require( './y_is_huge.js' );
5051
var yIsInfinite = require( './y_is_infinite.js' );
@@ -55,9 +56,6 @@ var pow2 = require( './pow2.js' );
5556

5657
// VARIABLES //
5758

58-
// 0x7fffffff = 2147483647 => 0 11111111111 11111111111111111111
59-
var ABS_MASK = 0x7fffffff|0; // asm type annotation
60-
6159
// 0x3fefffff = 1072693247 => 0 01111111110 11111111111111111111 => biased exponent: 1022 = -1+1023 => 2^-1
6260
var HIGH_MAX_NEAR_UNITY = 0x3fefffff|0; // asm type annotation
6361

@@ -88,10 +86,10 @@ var TINY = 1.0e-300;
8886
var OVT = 8.0085662595372944372e-17;
8987

9088
// High/low words workspace:
91-
var WORDS = [ 0|0, 0|0 ]; // WARNING: not thread safe
89+
var WORDS = [ 0|0, 0|0 ];
9290

9391
// Log workspace:
94-
var LOG_WORKSPACE = [ 0.0, 0.0 ]; // WARNING: not thread safe
92+
var LOG_WORKSPACE = [ 0.0, 0.0 ];
9593

9694

9795
// MAIN //
@@ -367,11 +365,11 @@ function pow( x, y ) {
367365
else if ( (j&ABS_MASK) >= HIGH_1075 ) {
368366
// z < -1075
369367
if ( ((j-HIGH_NEG_1075)|i) !== 0 ) {
370-
// signal underflow...
368+
// Signal underflow...
371369
return sx * TINY * TINY;
372370
}
373371
if ( lp <= (z-hp) ) {
374-
// signal underflow...
372+
// Signal underflow...
375373
return sx * TINY * TINY;
376374
}
377375
}

lib/node_modules/@stdlib/math/base/special/pow/lib/pow2.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,13 @@ var uint32ToInt32 = require( '@stdlib/number/uint32/base/to-int32' );
4141
var ldexp = require( '@stdlib/math/base/special/ldexp' );
4242
var LN2 = require( '@stdlib/constants/float64/ln-two' );
4343
var BIAS = require( '@stdlib/constants/float64/exponent-bias' );
44+
var ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' );
45+
var HIGH_SIGNIFICAND_MASK = require( '@stdlib/constants/float64/high-word-significand-mask' );
4446
var polyvalP = require( './polyval_p.js' );
4547

4648

4749
// VARIABLES //
4850

49-
// 0x7fffffff = 2147483647 => 0 11111111111 11111111111111111111
50-
var ABS_MASK = 0x7fffffff|0; // asm type annotation
51-
52-
// 0x000fffff = 1048575 => 0 00000000000 11111111111111111111
53-
var HIGH_SIGNIFICAND_MASK = 0x000fffff|0; // asm type annotation
54-
5551
// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022
5652
var HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation
5753

lib/node_modules/@stdlib/math/base/special/pow/lib/y_is_huge.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@
3434

3535
// MODULES //
3636

37+
var ABS_MASK = require( '@stdlib/constants/float64/high-word-abs-mask' );
3738
var getHighWord = require( '@stdlib/number/float64/base/get-high-word' );
3839

3940

4041
// VARIABLES //
4142

42-
// 0x7fffffff = 2147483647 => 0 11111111111 11111111111111111111
43-
var ABS_MASK = 0x7fffffff|0; // asm type annotation
44-
4543
// 0x3fefffff = 1072693247 => 0 01111111110 11111111111111111111 => biased exponent: 1022 = -1+1023 => 2^-1
4644
var HIGH_MAX_NEAR_UNITY = 0x3fefffff|0; // asm type annotation
4745

@@ -76,19 +74,19 @@ function pow( x, y ) {
7674

7775
if ( ahx <= HIGH_MAX_NEAR_UNITY ) {
7876
if ( y < 0 ) {
79-
// signal overflow...
77+
// Signal overflow...
8078
return HUGE * HUGE;
8179
}
82-
// signal underflow...
80+
// Signal underflow...
8381
return TINY * TINY;
8482
}
8583
// `x` has a biased exponent greater than or equal to `0`...
8684

8785
if ( y > 0 ) {
88-
// signal overflow...
86+
// Signal overflow...
8987
return HUGE * HUGE;
9088
}
91-
// signal underflow...
89+
// Signal underflow...
9290
return TINY * TINY;
9391
}
9492

0 commit comments

Comments
 (0)