Skip to content

Commit a1fbf46

Browse files
committed
fix: require sigma be greater than zero
--- 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: passed - task: lint_javascript_src status: passed - 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: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 7b347fa commit a1fbf46

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

lib/node_modules/@stdlib/stats/base/dists/halfnormal/stdev/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The [standard deviation][standard-deviation] for a [half-normal][half-normal-dis
3636

3737
<!-- </equation> -->
3838

39-
where `σ >= 0` is the scale parameter.
39+
where `σ > 0` is the scale parameter.
4040

4141
</section>
4242

@@ -64,7 +64,7 @@ y = stdev( 3.5 );
6464
// returns ~2.1098
6565
```
6666

67-
If provided `sigma < 0`, the function returns `NaN`.
67+
If provided `sigma <= 0`, the function returns `NaN`.
6868

6969
```javascript
7070
var y = stdev( -1.0 );

lib/node_modules/@stdlib/stats/base/dists/halfnormal/stdev/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{alias}}( σ )
22
Returns the standard deviation of a half-normal distribution.
33

4-
If provided `σ < 0`, the function returns `NaN`.
4+
If provided `σ <= 0`, the function returns `NaN`.
55

66
Parameters
77
----------

lib/node_modules/@stdlib/stats/base/dists/halfnormal/stdev/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* ## Notes
2525
*
26-
* - If provided `σ < 0`, the function returns `NaN`.
26+
* - If provided `σ <= 0`, the function returns `NaN`.
2727
*
2828
* @param sigma - scale parameter
2929
* @returns standard deviation

lib/node_modules/@stdlib/stats/base/dists/halfnormal/stdev/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var SQRT1M2PI = sqrt( 1.0 - (2.0/PI) );
5555
* // returns NaN
5656
*/
5757
function stdev( sigma ) {
58-
if ( isnan( sigma ) || sigma < 0 ) {
58+
if ( isnan( sigma ) || sigma <= 0 ) {
5959
return NaN;
6060
}
6161
return sigma * SQRT1M2PI;

lib/node_modules/@stdlib/stats/base/dists/halfnormal/stdev/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static const double SQRT1M2PI = 0.6028102749890869; // sqrt(1 - 2/pi)
3232
* // returns ~1.2056
3333
*/
3434
double stdlib_base_dists_halfnormal_stdev( const double sigma ) {
35-
if ( stdlib_base_is_nan( sigma ) || sigma < 0.0 ) {
35+
if ( stdlib_base_is_nan( sigma ) || sigma <= 0.0 ) {
3636
return 0.0/0.0; // NaN
3737
}
3838
return sigma * SQRT1M2PI;

lib/node_modules/@stdlib/stats/base/dists/halfnormal/stdev/test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ tape( 'if provided `NaN`, the function returns `NaN`', function test( t ) {
4747
t.end();
4848
});
4949

50-
tape( 'if provided a negative number, the function returns `NaN`', function test( t ) {
50+
tape( 'if provided a non-positive number, the function returns `NaN`', function test( t ) {
5151
var sigma;
5252

5353
sigma = stdev( -1.0 );

lib/node_modules/@stdlib/stats/base/dists/halfnormal/stdev/test/test.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ tape( 'if provided `NaN`, the function returns `NaN`', opts, function test( t )
5656
t.end();
5757
});
5858

59-
tape( 'if provided a negative number, the function returns `NaN`', opts, function test( t ) {
59+
tape( 'if provided a non-positive number, the function returns `NaN`', opts, function test( t ) {
6060
var sigma;
6161

6262
sigma = stdev( -1.0 );

0 commit comments

Comments
 (0)