Skip to content

Commit 067ef55

Browse files
fix: correct c files
--- 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: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - 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: missing_dependencies - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 896c5a5 commit 067ef55

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

lib/node_modules/@stdlib/math/base/special/log10f/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The [common logarithm][common-logarithm] (logarithm with base 10) is defined for
5151
var log10f = require( '@stdlib/math/base/special/log10f' );
5252
```
5353

54-
#### log10( x )
54+
#### log10f( x )
5555

5656
Evaluates the [common logarithm][common-logarithm].
5757

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ float stdlib_base_log10f( float x ){
6969
float y;
7070
float hfsq;
7171
float r;
72-
float hi;
72+
uint32_t hi;
7373
float lo;
7474
float f;
75+
float hii;
7576

7677
if ( stdlib_base_is_nanf( x ) || x < 0.0 ) {
7778
return 0.0 / 0.0; // NaN
@@ -114,7 +115,8 @@ float stdlib_base_log10f( float x ){
114115
}
115116
hi = f - hfsq;
116117
stdlib_base_float32_to_word( ihx, &hi );
117-
stdlib_base_float32_from_word( hi, ihx & 0xfffff000 );
118-
lo = ( f - hi ) - hfsq + r ;
119-
return y * LOG10_2LO + ( lo + hi ) * IVLN10LO + lo * IVLN10HI + hi * IVLN10HI + y * LOG10_2HI;
118+
hii= (float)hi;
119+
stdlib_base_float32_from_word( (uint32_t)( ihx & 0xfffff000 ) , &hii );
120+
lo = ( f - hii ) - hfsq + r ;
121+
return y * LOG10_2LO + ( lo + hii ) * IVLN10LO + lo * IVLN10HI + hii * IVLN10HI + y * LOG10_2HI;
120122
}

lib/node_modules/@stdlib/math/base/special/log10f/test/test.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ var EPS = require( '@stdlib/constants/float32/eps' );
2828
var abs = require( '@stdlib/math/base/special/abs' );
2929
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
3030
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
31+
var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' );
3132
var log10f = require( './../lib' );
32-
33-
34-
// FIXTURES //
35-
3633
var veryLargePositive = require( './fixtures/julia/very_large_positive.json' );
3734
var largePositive = require( './fixtures/julia/large_positive.json' );
3835
var mediumPositive = require( './fixtures/julia/medium_positive.json' );
@@ -143,7 +140,7 @@ tape( 'the function evaluates the common logarithm of `x` (small positive values
143140
t.strictEqual( y, e, 'x: '+x[i]+', y: '+y+', expected: '+e );
144141
} else {
145142
delta = abs( y - e );
146-
tol = 106.0 * EPS * abs( e );
143+
tol = ulpdiff( y, e );
147144
t.strictEqual( delta <= tol, true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. Tolerance: '+tol+'.' );
148145
}
149146
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var abs = require( '@stdlib/math/base/special/abs' );
3030
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
3131
var isPositiveZero = require( '@stdlib/math/base/assert/is-positive-zero' );
3232
var tryRequire = require( '@stdlib/utils/try-require' );
33+
var ulpdiff = require( '@stdlib/number/float32/base/ulp-difference' );
3334

3435

3536
// FIXTURES //
@@ -152,7 +153,7 @@ tape( 'the function evaluates the common logarithm of `x` (small positive values
152153
t.strictEqual( y, e, 'x: '+x[i]+', y: '+y+', expected: '+e );
153154
} else {
154155
delta = abs( y - e );
155-
tol = 106.0 * EPS * abs( e );
156+
tol = ulpdiff( y, e );
156157
t.strictEqual( delta <= tol, true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. Tolerance: '+tol+'.' );
157158
}
158159
}
@@ -177,7 +178,7 @@ tape( 'the function evaluates the common logarithm of `x` (smaller positive valu
177178
t.strictEqual( y, e, 'x: '+x[i]+', y: '+y+', expected: '+e );
178179
} else {
179180
delta = abs( y - e );
180-
tol = 1.8 * EPS * abs( e );
181+
tol = 2.0 * EPS * abs( e );
181182
t.strictEqual( delta <= tol, true, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. Tolerance: '+tol+'.' );
182183
}
183184
}

0 commit comments

Comments
 (0)