Skip to content

Commit 6131fa9

Browse files
committed
chore: add c documentation
1 parent c118bc9 commit 6131fa9

File tree

1 file changed

+95
-0
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/gumbel/skewness

1 file changed

+95
-0
lines changed

lib/node_modules/@stdlib/stats/base/dists/gumbel/skewness/README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,101 @@ for ( i = 0; i < 10; i++ ) {
133133

134134
<!-- /.examples -->
135135

136+
<!-- C interface documentation. -->
137+
138+
* * *
139+
140+
<section class="c">
141+
142+
## C APIs
143+
144+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
145+
146+
<section class="intro">
147+
148+
</section>
149+
150+
<!-- /.intro -->
151+
152+
<!-- C usage documentation. -->
153+
154+
<section class="usage">
155+
156+
### Usage
157+
158+
```c
159+
#include "stdlib/stats/base/dists/gumbel/skewness.h"
160+
```
161+
162+
#### stdlib_base_dists_gumbel_skewness( mu, beta )
163+
164+
Returns the skewness for a Gumbel distribution with location `mu` and scale `beta`.
165+
166+
```c
167+
double y = stdlib_base_dists_gumbel_skewness( 0.0, 1.0 );
168+
// returns ~1.14
169+
```
170+
171+
The function accepts the following arguments:
172+
173+
- **mu**: `[in] double` location parameter.
174+
- **beta**: `[in] double` scale parameter.
175+
176+
```c
177+
double stdlib_base_dists_gumbel_skewness( const double mu, const double beta );
178+
```
179+
180+
</section>
181+
182+
<!-- /.usage -->
183+
184+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
185+
186+
<section class="notes">
187+
188+
</section>
189+
190+
<!-- /.notes -->
191+
192+
<!-- C API usage examples. -->
193+
194+
<section class="examples">
195+
196+
### Examples
197+
198+
```c
199+
#include "stdlib/stats/base/dists/gumbel/skewness.h"
200+
#include <stdlib.h>
201+
#include <stdio.h>
202+
203+
static double random_uniform( const double min, const double max ) {
204+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
205+
return min + ( v*(max-min) );
206+
}
207+
208+
int main( void ) {
209+
double mu;
210+
double beta;
211+
double y;
212+
int i;
213+
214+
for ( i = 0; i < 25; i++ ) {
215+
mu = random_uniform( -5.0, 5.0 );
216+
beta = random_uniform( 0.0, 20.0 );
217+
y = stdlib_base_dists_gumbel_skewness( mu, beta );
218+
printf( "µ: %lf, β: %lf, Skew(X;µ,β): %lf\n", mu, beta, y );
219+
s}
220+
}
221+
```
222+
223+
</section>
224+
225+
<!-- /.examples -->
226+
227+
</section>
228+
229+
<!-- /.c -->
230+
136231
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
137232

138233
<section class="references">

0 commit comments

Comments
 (0)