Skip to content

Commit 8f6a179

Browse files
committed
chore: clean-up and fix test tolerances
--- 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: 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 a2ab0a6 commit 8f6a179

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

lib/node_modules/@stdlib/stats/base/dists/weibull/entropy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ static double random_uniform( const double min, const double max ) {
217217
}
218218
219219
int main( void ) {
220-
double k;
221220
double lambda;
221+
double k;
222222
double y;
223223
int i;
224224

lib/node_modules/@stdlib/stats/base/dists/weibull/entropy/src/addon.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@
1919
#include "stdlib/stats/base/dists/weibull/entropy.h"
2020
#include "stdlib/math/base/napi/binary.h"
2121

22-
// cppcheck-suppress shadowFunction
2322
STDLIB_MATH_BASE_NAPI_MODULE_DD_D( stdlib_base_dists_weibull_entropy )

lib/node_modules/@stdlib/stats/base/dists/weibull/entropy/test/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var abs = require( '@stdlib/math/base/special/abs' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var PINF = require( '@stdlib/constants/float64/pinf' );
2727
var NINF = require( '@stdlib/constants/float64/ninf' );
28+
var EPS = require( '@stdlib/constants/float64/eps' );
2829
var entropy = require( './../lib' );
2930

3031

@@ -111,7 +112,7 @@ tape( 'the function returns the differential entropy of a Weibull distribution',
111112
t.equal( y, expected[i], 'k: '+k[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
112113
} else {
113114
delta = abs( y - expected[ i ] );
114-
tol = 1e-11 * abs( expected[ i ] );
115+
tol = 1.0 * EPS * abs( expected[ i ] );
115116
t.ok( delta <= tol, 'within tolerance. k: '+k[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
116117
}
117118
}

lib/node_modules/@stdlib/stats/base/dists/weibull/entropy/test/test.native.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var abs = require( '@stdlib/math/base/special/abs' );
2727
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2828
var PINF = require( '@stdlib/constants/float64/pinf' );
2929
var NINF = require( '@stdlib/constants/float64/ninf' );
30+
var EPS = require( '@stdlib/constants/float64/eps' );
3031

3132

3233
// VARIABLES //
@@ -120,7 +121,7 @@ tape( 'the function returns the differential entropy of a Weibull distribution',
120121
t.equal( y, expected[i], 'k: '+k[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
121122
} else {
122123
delta = abs( y - expected[ i ] );
123-
tol = 1e-11 * abs( expected[ i ] );
124+
tol = 1.0 * EPS * abs( expected[ i ] );
124125
t.ok( delta <= tol, 'within tolerance. k: '+k[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
125126
}
126127
}

0 commit comments

Comments
 (0)