Skip to content

Commit 819d4f2

Browse files
committed
chore: reorder if statements
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent a406ffd commit 819d4f2

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,6 @@ function powf( x, y ) {
264264
z = f32( lp + hp );
265265
j = toWordf( z ) | 0; // asm type annotation
266266

267-
// z < -150
268-
if ( (j&ABS_MASK) > Z_UNF_WORD ) {
269-
// Signal underflow...
270-
return f32( f32( sn * TINY ) * TINY );
271-
}
272-
// z == -150
273-
if ( j === Z_NEG_UNF_WORD ) {
274-
if ( lp <= f32( z-hp ) ) {
275-
// Signal underflow...
276-
return f32( f32( sn * TINY ) * TINY );
277-
}
278-
}
279267
// z > 128
280268
if ( j > Z_OVF_WORD ) {
281269
// Signal overflow...
@@ -288,6 +276,18 @@ function powf( x, y ) {
288276
return f32( f32( sn * HUGE ) * HUGE );
289277
}
290278
}
279+
// z < -150
280+
if ( (j&ABS_MASK) > Z_UNF_WORD ) {
281+
// Signal underflow...
282+
return f32( f32( sn * TINY ) * TINY );
283+
}
284+
// z == -150
285+
if ( j === Z_NEG_UNF_WORD ) {
286+
if ( lp <= f32( z-hp ) ) {
287+
// Signal underflow...
288+
return f32( f32( sn * TINY ) * TINY );
289+
}
290+
}
291291
// Compute `2^(hp+lp)`...
292292
z = pow2f( j, hp, lp );
293293

lib/node_modules/@stdlib/math/base/special/powf/src/main.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -624,18 +624,6 @@ float stdlib_base_powf( const float x, const float y ) {
624624
stdlib_base_float32_to_word( z, &j );
625625
jc = (int32_t)j;
626626

627-
// z < -150
628-
if ( (jc & STDLIB_CONSTANT_FLOAT32_ABS_MASK) > Z_UNF_WORD ) {
629-
// Signal underflow...
630-
return sn * TINY_VALUE * TINY_VALUE;
631-
}
632-
// z == -150
633-
if ( jc == Z_NEG_UNF_WORD ) {
634-
if ( lp <= ( z - hp ) ) {
635-
// Signal underflow...
636-
return sn * TINY_VALUE * TINY_VALUE;
637-
}
638-
}
639627
// z > 128
640628
if ( jc > Z_OVF_WORD ) {
641629
// Signal overflow...
@@ -648,6 +636,18 @@ float stdlib_base_powf( const float x, const float y ) {
648636
return sn * HUGE_VALUE * HUGE_VALUE;
649637
}
650638
}
639+
// z < -150
640+
if ( (jc & STDLIB_CONSTANT_FLOAT32_ABS_MASK) > Z_UNF_WORD ) {
641+
// Signal underflow...
642+
return sn * TINY_VALUE * TINY_VALUE;
643+
}
644+
// z == -150
645+
if ( jc == Z_NEG_UNF_WORD ) { // cppcheck-suppress knownConditionTrueFalse
646+
if ( lp <= ( z - hp ) ) {
647+
// Signal underflow...
648+
return sn * TINY_VALUE * TINY_VALUE;
649+
}
650+
}
651651
// Compute `2^(hp+lp)`...
652652
z = pow2f( j, hp, lp );
653653
return sn * z;

lib/node_modules/@stdlib/math/base/special/powf/test/test.native.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
3636
var isPositiveZerof = require( '@stdlib/math/base/assert/is-positive-zerof' );
3737
var isNegativeZerof = require( '@stdlib/math/base/assert/is-negative-zerof' );
3838
var tryRequire = require( '@stdlib/utils/try-require' );
39+
40+
41+
// FIXTURES //
42+
3943
var squaredSmall = require( './fixtures/julia/squared_small.json' );
4044
var squaredLarge = require( './fixtures/julia/squared_large.json' );
4145
var cubedSmall = require( './fixtures/julia/cubed_small.json' );

0 commit comments

Comments
 (0)