Skip to content

Commit e403884

Browse files
committed
bench: ensure NaN is not possible
--- 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: na - 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: passed - 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 f7f08b6 commit e403884

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/node_modules/@stdlib/stats/base/dists/gamma/variance/benchmark/c/benchmark.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include "stdlib/stats/base/dists/gamma/variance.h"
20+
#include "stdlib/constants/float64/eps.h"
2021
#include <stdlib.h>
2122
#include <stdio.h>
2223
#include <math.h>
@@ -100,8 +101,8 @@ static double benchmark( void ) {
100101
int i;
101102

102103
for ( i = 0; i < 100; i++ ) {
103-
alpha[ i ] = random_uniform( 0.0, 20.0 );
104-
beta[ i ] = random_uniform( 0.0, 20.0 );
104+
alpha[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
105+
beta[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
105106
}
106107

107108
t = tic();

lib/node_modules/@stdlib/stats/base/dists/gamma/variance/manifest.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
],
5353
"libraries": [],
5454
"libpath": [],
55-
"dependencies": []
55+
"dependencies": [
56+
"@stdlib/constants/float64/eps"
57+
]
5658
},
5759
{
5860
"task": "examples",

0 commit comments

Comments
 (0)