File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
lib/node_modules/@stdlib/stats/base/dists/binomial/median Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 11/**
22* @license Apache-2.0
33*
4- * Copyright (c) 2024 The Stdlib Authors.
4+ * Copyright (c) 2018 The Stdlib Authors.
55*
66* Licensed under the Apache License, Version 2.0 (the "License");
77* you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 3939 "libpath" : [],
4040 "dependencies" : [
4141 " @stdlib/math/base/napi/binary" ,
42- " @stdlib/math/base/assert/is-nan"
42+ " @stdlib/math/base/assert/is-nan" ,
43+ " @stdlib/math/base/assert/is-nonnegative-integerf"
4344 ]
4445 },
4546 {
5455 "libraries" : [],
5556 "libpath" : [],
5657 "dependencies" : [
57- " @stdlib/math/base/assert/is-nan"
58+ " @stdlib/math/base/assert/is-nan" ,
59+ " @stdlib/math/base/assert/is-nonnegative-integerf"
5860 ]
5961 },
6062 {
6971 "libraries" : [],
7072 "libpath" : [],
7173 "dependencies" : [
72- " @stdlib/math/base/assert/is-nan"
74+ " @stdlib/math/base/assert/is-nan" ,
75+ " @stdlib/math/base/assert/is-nonnegative-integerf"
7376 ]
7477 }
7578 ]
Original file line number Diff line number Diff line change 1818
1919#include "stdlib/stats/base/dists/binomial/median.h"
2020#include "stdlib/math/base/assert/is_nan.h"
21+ #include "stdlib/math/base/assert/is_nonnegative_integerf.h"
2122#include <math.h>
2223
2324/**
3839double stdlib_base_dists_binomial_median ( const double n , const double p ) {
3940 if (
4041 stdlib_base_is_nan ( p ) ||
42+ stdlib_base_is_nan ( n ) ||
43+ !stdlib_base_is_nonnegative_integerf ( n ) ||
4144 p < 0.0 ||
4245 p > 1.0 ||
43- n < 0
46+ n < 0 ||
47+ n > 1.0e6
4448 ) {
4549 return 0.0 / 0.0 ; // NaN
4650 }
You can’t perform that action at this time.
0 commit comments