Skip to content

Commit 2a0d375

Browse files
committed
refactor: added include in main.c and fixed the JS benchmark number generation
--- 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: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 8b91b02 commit 2a0d375

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/node_modules/@stdlib/stats/base/dists/degenerate/mgf/benchmark/benchmark.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
var bench = require( '@stdlib/bench' );
2424
var randu = require( '@stdlib/random/base/randu' );
25+
var uniform = require( '@stdlib/random/base/uniform' );
2526
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2627
var pkg = require( './../package.json' ).name;
2728
var mgf = require( './../lib' );
@@ -37,8 +38,8 @@ bench( pkg, function benchmark( b ) {
3738

3839
b.tic();
3940
for ( i = 0; i < b.iterations; i++ ) {
40-
t = ( randu()*100.0 ) - 100;
41-
mu = ( randu()*100.0 ) - 50.0;
41+
t = uniform( -100.0, 0.0 );
42+
mu = uniform( -50.0, 50.0 );
4243
y = mgf( t, mu );
4344
if ( isnan( y ) ) {
4445
b.fail( 'should not return NaN' );

lib/node_modules/@stdlib/stats/base/dists/degenerate/mgf/src/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "stdlib/math/base/assert/is_nan.h"
2020
#include "stdlib/math/base/special/exp.h"
21+
#include "stdlib/stats/base/dists/degenerate/mgf.h"
2122

2223
/**
2324
* Evaluates the moment-generating function (MGF) for a degenerate distribution centered at `mu`.

0 commit comments

Comments
 (0)