Skip to content

Commit 7239f34

Browse files
committed
style: align stats/base/dists/negative-binomial/mean with namespace conventions
Merged the two-block argument validation prologue in `lib/main.js` and `src/main.c` into a single `if`-block, matching the convention used by 10/12 sibling packages in `@stdlib/stats/base/dists/negative-binomial` (83% conformance) and 6/7 native-binding C siblings (86% conformance). Behavior is unchanged: invalid inputs still return NaN.
1 parent be59f0c commit 7239f34

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

  • lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mean

lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mean/lib/main.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
6363
function mean( r, p ) {
6464
if (
6565
isnan( r ) ||
66-
isnan( p )
67-
) {
68-
return NaN;
69-
}
70-
if (
66+
isnan( p ) ||
7167
r <= 0.0 ||
7268
p < 0.0 ||
7369
p > 1.0

lib/node_modules/@stdlib/stats/base/dists/negative-binomial/mean/src/main.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@
3333
double stdlib_base_dists_negative_binomial_mean( const double r, const double p ) {
3434
if (
3535
stdlib_base_is_nan( r ) ||
36-
stdlib_base_is_nan( p )
37-
) {
38-
return 0.0 / 0.0; // NaN
39-
}
40-
if (
36+
stdlib_base_is_nan( p ) ||
4137
r <= 0.0 ||
4238
p < 0.0 ||
4339
p > 1.0

0 commit comments

Comments
 (0)