Skip to content

Commit d5ef35f

Browse files
committed
docs: update README with C API documentation
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent a2066f5 commit d5ef35f

File tree

1 file changed

+95
-0
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/degenerate/stdev

1 file changed

+95
-0
lines changed

lib/node_modules/@stdlib/stats/base/dists/degenerate/stdev/README.md

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

112112
<!-- /.examples -->
113113

114+
<!-- C interface documentation. -->
115+
116+
* * *
117+
118+
<section class="c">
119+
120+
## C APIs
121+
122+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
123+
124+
<section class="intro">
125+
126+
</section>
127+
128+
<!-- /.intro -->
129+
130+
<!-- C usage documentation. -->
131+
132+
<section class="usage">
133+
134+
### Usage
135+
136+
```c
137+
#include "stdlib/stats/base/dists/degenerate/stdev.h"
138+
```
139+
140+
#### stdlib_base_dists_degenerate_stdev( mu )
141+
142+
Returns the standard deviation of a degenerate distribution.
143+
144+
```c
145+
double out = stdlib_base_dists_degenerate_stdev( 0.1 );
146+
// returns 0.0
147+
```
148+
149+
The function accepts the following arguments:
150+
151+
- **mu**: `[in] double` constant value of the distribution.
152+
153+
```c
154+
double stdlib_base_dists_degenerate_stdev( const double mu );
155+
```
156+
157+
</section>
158+
159+
<!-- /.usage -->
160+
161+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
162+
163+
<section class="notes">
164+
165+
</section>
166+
167+
<!-- /.notes -->
168+
169+
<!-- C API usage examples. -->
170+
171+
<section class="examples">
172+
173+
### Examples
174+
175+
```c
176+
#include "stdlib/stats/base/dists/degenerate/stdev.h"
177+
#include <stdlib.h>
178+
#include <stdio.h>
179+
180+
static double random_uniform( const double min, const double max ) {
181+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
182+
return min + ( v * ( max - min ) );
183+
}
184+
185+
int main( void ) {
186+
double mu;
187+
double result;
188+
int i;
189+
190+
for ( i = 0; i < 10; i++ ) {
191+
mu = random_uniform( -20.0, 20.0 );
192+
result = stdlib_base_dists_degenerate_stdev( mu );
193+
194+
printf( "mu: %lf, Standard Deviation: %lf \n", mu, result );
195+
}
196+
197+
return 0;
198+
}
199+
```
200+
201+
</section>
202+
203+
<!-- /.examples -->
204+
205+
</section>
206+
207+
<!-- /.c -->
208+
114209
<!-- 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. -->
115210

116211
<section class="references">

0 commit comments

Comments
 (0)