Skip to content

Commit

Permalink
chore: solve linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-095 committed Mar 5, 2024
1 parent 5c08d76 commit dc44d62
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/node_modules/@stdlib/math/base/special/log2/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
// VARIABLES //

// 0x000fffff = 1048575 => 0 00000000000 11111111111111111111
static const uint32_t HIGH_SIGNIFICAND_MASK = 0x000fffff|0; // asm type annotation
static const uint32_t HIGH_SIGNIFICAND_MASK = 0x000fffff;

// 1/3
static const double ONE_THIRD = 0.33333333333333333;
Expand All @@ -75,13 +75,13 @@ static const double IVLN2HI = 1.44269504072144627571e+00; // 0x3ff71547, 0x65200
static const double IVLN2LO = 1.67517131648865118353e-10; // 0x3de705fc, 0x2eefa200

// 0x7ff00000 = 2146435072 => 0 11111111111 00000000000000000000 => biased exponent: 2047 = 1023+1023 => 2^1023
static const uint32_t HIGH_MAX_NORMAL_EXP = 0x7ff00000|0; // asm type annotation
static const uint32_t HIGH_MAX_NORMAL_EXP = 0x7ff00000;

// 0x00100000 = 1048576 => 0 00000000001 00000000000000000000 => biased exponent: 1 = -1022+1023 => 2^-1022
static const uint32_t HIGH_MIN_NORMAL_EXP = 0x00100000|0; // asm type annotation
static const uint32_t HIGH_MIN_NORMAL_EXP = 0x00100000;

// 0x3ff00000 = 1072693248 => 0 01111111111 00000000000000000000 => biased exponent: 1023 = 0+1023 => 2^0 = 1
static const uint32_t HIGH_BIASED_EXP_0 = 0x3ff00000|0; // asm type annotation
static const uint32_t HIGH_BIASED_EXP_0 = 0x3ff00000;


// BEGIN: polyval_p
Expand Down Expand Up @@ -155,9 +155,9 @@ double klog( const double x ) {
s = f / ( 2.0 + f );
z = s * s;
hx &= HIGH_SIGNIFICAND_MASK;
i = ( hx - 0x6147a )|0; // asm type annotation
i = ( hx - 0x6147a );
w = z * z;
j = ( 0x6b851 - hx )|0; // asm type annotation
j = ( 0x6b851 - hx );
t1 = w * polyval_p( w );
t2 = z * polyval_q( w );
i |= j;
Expand Down Expand Up @@ -190,13 +190,13 @@ double stdlib_base_log2( const double x ) {
return 0.0 / 0.0; // NaN
}
stdlib_base_float64_to_words( xc, &hx, &lx );
k = 0|0; // asm type annotation
k = 0;
if ( hx < HIGH_MIN_NORMAL_EXP ) {
// Case: x < 2**-1022
if ( ( ( hx & STDLIB_CONSTANT_FLOAT64_HIGH_WORD_ABS_MASK ) | lx ) == 0 ) {
return STDLIB_CONSTANT_FLOAT64_NINF;
}
k -= 54|0; // asm type annotation
k -= 54; // asm type annotation

// Subnormal number, scale up x:
xc *= TWO54;
Expand All @@ -205,13 +205,13 @@ double stdlib_base_log2( const double x ) {
if ( hx >= HIGH_MAX_NORMAL_EXP ) {
return xc + xc;
}
k += ( ( hx>>20 ) - STDLIB_CONSTANT_FLOAT64_EXPONENT_BIAS )|0; // asm type annotation
k += ( ( hx>>20 ) - STDLIB_CONSTANT_FLOAT64_EXPONENT_BIAS ); // asm type annotation
hx &= HIGH_SIGNIFICAND_MASK;
i = ( ( hx + 0x95f64 ) & 0x100000 )|0; // asm type annotation
i = ( ( hx + 0x95f64 ) & 0x100000 ); // asm type annotation

// Normalize x or x/2...
stdlib_base_float64_set_high_word( hx|( i^HIGH_BIASED_EXP_0 ), &xc );
k += (i>>20)|0; // asm type annotation
k += (i>>20); // asm type annotation
f = klog( xc );
xc -= 1;
stdlib_base_float64_set_low_word( xc, &hi );
Expand Down

0 comments on commit dc44d62

Please sign in to comment.