Skip to content

Commit ca7e8b6

Browse files
committed
test: adjust tolerances and simplify assertions
--- 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: 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: na - 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 eeaf7c4 commit ca7e8b6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/node_modules/@stdlib/stats/base/dists/wald/mode/test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ tape( 'the function returns the mode of a Wald distribution', function test( t )
114114
lambda = data.lambda;
115115
for ( i = 0; i < mu.length; i++ ) {
116116
y = mode( mu[i], lambda[i] );
117-
t.strictEqual( isAlmostSameValue( y, expected[i], 2 ), true, 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
117+
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
118118
}
119119
t.end();
120120
});

lib/node_modules/@stdlib/stats/base/dists/wald/mode/test/test.native.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ tape( 'the function returns the mode of a Wald distribution', opts, function tes
123123
lambda = data.lambda;
124124
for ( i = 0; i < mu.length; i++ ) {
125125
y = mode( mu[i], lambda[i] );
126-
t.strictEqual( isAlmostSameValue( y, expected[i], 2 ), true, 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
126+
127+
// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
128+
t.strictEqual( isAlmostSameValue( y, expected[i], 16 ), true, 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
127129
}
128130
t.end();
129131
});

0 commit comments

Comments
 (0)