Skip to content

Commit 58ed035

Browse files
refactor: add int32_t logic around k parameter
1 parent 50f4d6a commit 58ed035

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ double y = stdlib_base_dists_erlang_kurtosis( 1.0, 1.0 );
178178

179179
The function accepts the following arguments:
180180

181-
- **k**: `[in] double` shape parameter.
181+
- **k**: `[in] int32_t` shape parameter.
182182
- **lambda**: `[in] double` rate parameter.
183183

184184
```c
185-
double stdlib_base_dists_erlang_kurtosis( const double k, const double lambda );
185+
double stdlib_base_dists_erlang_kurtosis( const isnt32_t k, const double lambda );
186186
```
187187
188188
</section>
@@ -208,6 +208,7 @@ element and another before the `/section` close. -->
208208
#include "stdlib/stats/base/dists/erlang/kurtosis.h"
209209
#include "stdlib/math/base/special/round.h"
210210
#include "stdlib/constants/float64/eps.h"
211+
#include <stdint.h>
211212
#include <stdlib.h>
212213
#include <stdio.h>
213214

lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/benchmark/c/benchmark.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "stdlib/stats/base/dists/erlang/kurtosis.h"
2020
#include "stdlib/math/base/special/ceil.h"
2121
#include "stdlib/constants/float64/eps.h"
22+
#include <stdint.h>
2223
#include <stdlib.h>
2324
#include <stdio.h>
2425
#include <math.h>
@@ -95,7 +96,7 @@ static double random_uniform( const double min, const double max ) {
9596
*/
9697
static double benchmark( void ) {
9798
double elapsed;
98-
double k[ 100 ];
99+
int32_t k[ 100 ];
99100
double lambda[ 100 ];
100101
double y;
101102
double t;

lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/examples/c/example.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "stdlib/stats/base/dists/erlang/kurtosis.h"
2020
#include "stdlib/math/base/special/round.h"
2121
#include "stdlib/constants/float64/eps.h"
22+
#include <stdint.h>
2223
#include <stdlib.h>
2324
#include <stdio.h>
2425

@@ -28,7 +29,7 @@ static double random_uniform( const double min, const double max ) {
2829
}
2930

3031
int main( void ) {
31-
double k;
32+
int32_t k;
3233
double lambda;
3334
double y;
3435
int i;

lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/include/stdlib/stats/base/dists/erlang/kurtosis.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef STDLIB_STATS_BASE_DISTS_ERLANG_KURTOSIS_H
2020
#define STDLIB_STATS_BASE_DISTS_ERLANG_KURTOSIS_H
2121

22+
#include <stdint.h>
23+
2224
/*
2325
* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler.
2426
*/
@@ -29,7 +31,7 @@ extern "C" {
2931
/**
3032
* Returns the excess kurtosis for a erlang distribution with shape parameter `k` and rate parameter `lambda`.
3133
*/
32-
double stdlib_base_dists_erlang_kurtosis( const double k, const double lambda );
34+
double stdlib_base_dists_erlang_kurtosis( const int32_t k, const double lambda );
3335

3436
#ifdef __cplusplus
3537
}

lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/src/addon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
#include "stdlib/math/base/napi/binary.h"
2121

2222
// cppcheck-suppress shadowFunction
23-
STDLIB_MATH_BASE_NAPI_MODULE_DD_D( stdlib_base_dists_erlang_kurtosis )
23+
STDLIB_MATH_BASE_NAPI_MODULE_ID_D( stdlib_base_dists_erlang_kurtosis )

lib/node_modules/@stdlib/stats/base/dists/erlang/kurtosis/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "stdlib/stats/base/dists/erlang/kurtosis.h"
2020
#include "stdlib/math/base/assert/is_positive_integer.h"
2121
#include "stdlib/math/base/assert/is_nan.h"
22-
22+
#include <stdint.h>
2323
/**
2424
* Returns the excess kurtosis for a erlang distribution with shape parameter `k` and rate parameter `lambda`.
2525
*
@@ -31,7 +31,7 @@
3131
* double y = stdlib_base_dists_beta_kurtosis( 1.0, 1.0 );
3232
* // returns 6.0
3333
*/
34-
double stdlib_base_dists_erlang_kurtosis( const double k, const double lambda ) {
34+
double stdlib_base_dists_erlang_kurtosis( const int32_t k, const double lambda ) {
3535
if (
3636
!stdlib_base_is_positive_integer( k ) ||
3737
stdlib_base_is_nan( lambda ) ||

0 commit comments

Comments
 (0)