File tree Expand file tree Collapse file tree 3 files changed +3
-4
lines changed
lib/node_modules/@stdlib/stats/base/dists/erlang/mode Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ var addon = require( './../src/addon.node' );
50
50
* // returns NaN
51
51
*
52
52
* @example
53
- * var v = mode( -0. 1, 1.0 );
53
+ * var v = mode( -1, 1.0 );
54
54
* // returns NaN
55
55
*
56
56
* @example
Original file line number Diff line number Diff line change 19
19
#include "stdlib/stats/base/dists/erlang/mode.h"
20
20
#include "stdlib/math/base/napi/binary.h"
21
21
22
- // cppcheck-suppress shadowFunction
23
22
STDLIB_MATH_BASE_NAPI_MODULE_ID_D ( stdlib_base_dists_erlang_mode )
Original file line number Diff line number Diff line change 33
33
*/
34
34
double stdlib_base_dists_erlang_mode ( const int32_t k , const double lambda ) {
35
35
if (
36
- k <= 0.0 ||
36
+ k <= 0 ||
37
37
stdlib_base_is_nan ( lambda ) ||
38
38
lambda <= 0.0
39
39
) {
40
40
return 0.0 /0.0 ; // NaN
41
41
}
42
- return ( k - 1 ) / lambda ;
42
+ return ( ( double ) k - 1.0 ) / lambda ;
43
43
}
You can’t perform that action at this time.
0 commit comments