You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [`8bb1cf3`](https://github.com/stdlib-js/stdlib/commit/8bb1cf3e5a003c54a909412cda9143d85ec10f30) - add C implementation for `dist/triangular/median` [(#4004)](https://github.com/stdlib-js/stdlib/pull/4004)
@@ -2244,6 +2278,7 @@ A total of 17 people contributed to this release. Thank you to the following con
2244
2278
2245
2279
<details>
2246
2280
2281
+
- [`8bb1cf3`](https://github.com/stdlib-js/stdlib/commit/8bb1cf3e5a003c54a909412cda9143d85ec10f30) - **feat:** add C implementation for `dist/triangular/median` [(#4004)](https://github.com/stdlib-js/stdlib/pull/4004) _(by Divyansh Seth, Philipp Burckhardt)_
2247
2282
- [`fc5df17`](https://github.com/stdlib-js/stdlib/commit/fc5df1769306302648f8ed492455558447c47d8f) - **feat:** add C implementation for `stats/base/dists/kumaraswamy/median` [(#4020)](https://github.com/stdlib-js/stdlib/pull/4020) _(by Desh Deepak Kant, Philipp Burckhardt)_
2248
2283
- [`9d270ad`](https://github.com/stdlib-js/stdlib/commit/9d270ad8299ceb0723b1b805e738fbe19faa6520) - **feat:** add C implementation for `stats/base/dists/rayleigh/mean` [(#4026)](https://github.com/stdlib-js/stdlib/pull/4026) _(by JoyBoy, Philipp Burckhardt)_
2249
2284
- [`7d9b63d`](https://github.com/stdlib-js/stdlib/commit/7d9b63ddd452bf4cc171bdd21cf666274d3eeb56) - **feat:** add C implementation for `stats/base/dists/exponential/mode` [(#4047)](https://github.com/stdlib-js/stdlib/pull/4047) _(by JoyBoy, Philipp Burckhardt)_
Copy file name to clipboardExpand all lines: base/dists/triangular/median/README.md
+94Lines changed: 94 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,6 +141,100 @@ for ( i = 0; i < 10; i++ ) {
141
141
142
142
<!-- /.examples -->
143
143
144
+
<!-- C interface documentation. -->
145
+
146
+
* * *
147
+
148
+
<sectionclass="c">
149
+
150
+
## C APIs
151
+
152
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
#### stdlib_base_dists_triangular_median( a, b, c )
171
+
172
+
Evaluates the [median][median] for a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode).
173
+
174
+
```c
175
+
double out = stdlib_base_dists_triangular_median( 0.0, 1.0, 0.8 );
176
+
// returns ~0.632
177
+
```
178
+
179
+
The function accepts the following arguments:
180
+
181
+
-**a**: `[in] double` lower limit.
182
+
-**b**: `[in] double` upper limit.
183
+
-**c**: `[in] double` mode.
184
+
185
+
```c
186
+
doublestdlib_base_dists_triangular_median( const double a, const double b, const double c );
187
+
```
188
+
189
+
</section>
190
+
191
+
<!-- /.usage -->
192
+
193
+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
214
+
return min + ( v*(max-min) );
215
+
}
216
+
217
+
int main( void ) {
218
+
double a;
219
+
double b;
220
+
double c;
221
+
double v;
222
+
int i;
223
+
224
+
for ( i = 0; i < 25; i++ ) {
225
+
a = random_uniform( 0.0, 10.0 );
226
+
b = random_uniform( a, a+10.0 );
227
+
c = random_uniform( a, b );
228
+
v = stdlib_base_dists_triangular_median( a, b, c );
229
+
printf( "a: %lf, b: %lf, c: %lf, Median(X;a,b,c): %lf\n", a, b, c, v );
230
+
}
231
+
}
232
+
```
233
+
234
+
</section>
235
+
236
+
<!-- /.examples -->
237
+
144
238
<!-- 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. -->
0 commit comments