Skip to content

Commit bbf728d

Browse files
committed
fix: remove cppcheck suppress, MAIN comment, use uniform over randu
--- 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: 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 6f20eb8 commit bbf728d

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

lib/node_modules/@stdlib/stats/base/dists/arcsine/quantile/benchmark/benchmark.native.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
26-
var randu = require( '@stdlib/random/base/randu' );
26+
var uniform = require( '@stdlib/random/base/uniform' );
2727
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2828
var tryRequire = require( '@stdlib/utils/try-require' );
2929
var pkg = require( './../package.json' ).name;
@@ -52,16 +52,16 @@ bench( pkg, opts, function benchmark( b ) {
5252
min = new Float64Array( len );
5353
max = new Float64Array( len );
5454
for ( i = 0; i < len; i++ ) {
55-
p[ i ] = randu();
56-
min[ i ] = ( randu()*20.0 ) - 20.0;
57-
max[ i ] = ( randu() * 40.0 ) + min[ i ];
55+
p[ i ] = uniform( 0.0, 1.0 );
56+
min[ i ] = uniform( -20.0, 0.0 );
57+
max[ i ] = uniform( min[ i ], min[ i ] + 40.0 );
5858
}
5959

6060
b.tic();
6161
for ( i = 0; i < b.iterations; i++ ) {
62-
p = randu();
63-
min = ( randu() * 20.0 ) - 20.0;
64-
max = min + ( randu() * 40.0 );
62+
p = uniform( 0.0, 1.0 );
63+
min = uniform( -20.0, 0.0 );
64+
max = min + uniform( 0.0, 40.0 );
6565
y = quantile( p, min, max );
6666
if ( isnan( y ) ) {
6767
b.fail( 'should not return NaN' );

lib/node_modules/@stdlib/stats/base/dists/arcsine/quantile/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/arcsine/quantile.h"
2020
#include "stdlib/math/base/napi/ternary.h"
2121

22-
// cppcheck-suppress shadowFunction
2322
STDLIB_MATH_BASE_NAPI_MODULE_DDD_D( stdlib_base_dists_arcsine_quantile )

lib/node_modules/@stdlib/stats/base/dists/arcsine/quantile/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
#include "stdlib/math/base/special/sin.h"
2323
#include "stdlib/constants/float64/half_pi.h"
2424

25-
// MAIN //
26-
2725
/**
2826
* Evaluates the quantile function for an arcsine distribution with minimum support `a` and maximum support `b` at a probability `p`.
2927
*

0 commit comments

Comments
 (0)