diff --git a/CHANGELOG.md b/CHANGELOG.md index 2562f66d2..c35724d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3239,6 +3239,28 @@ This release closes the following issue: +
+ +#### [@stdlib/math/base/special/gamma](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/gamma) + +
+ +
+ +##### Features + +- [`35af244`](https://github.com/stdlib-js/stdlib/commit/35af24442f634296da8248552f307229b1214c08) - add C implementation for `math/base/special/gamma` + +
+ + + +
+ +
+ + +
#### [@stdlib/math/base/special/gamma-lanczos-sum](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/gamma-lanczos-sum) @@ -5066,6 +5088,7 @@ A total of 29 people contributed to this release. Thank you to the following con
+- [`35af244`](https://github.com/stdlib-js/stdlib/commit/35af24442f634296da8248552f307229b1214c08) - **feat:** add C implementation for `math/base/special/gamma` _(by Gunj Joshi, Philipp Burckhardt)_ - [`26337e1`](https://github.com/stdlib-js/stdlib/commit/26337e1644c963b8006e38c4b5e2ee74eac8e33f) - **docs:** fix return annotation tag in C comments _(by Philipp Burckhardt)_ - [`8558d86`](https://github.com/stdlib-js/stdlib/commit/8558d869aed0f22f0fbdcd54321c5058c954df89) - **feat:** add `math/base/special/fmod` [(##2562)](#2562) _(by Gunj Joshi)_ - [`e9d0de8`](https://github.com/stdlib-js/stdlib/commit/e9d0de8077f47e49ff703c1b106e262454e5d15d) - **chore:** update package meta data [(#2596)](https://github.com/stdlib-js/stdlib/pull/2596) _(by stdlib-bot, Athan Reines)_ diff --git a/base/special/gamma/README.md b/base/special/gamma/README.md index 1e9f4c4ad..0cfc925f3 100644 --- a/base/special/gamma/README.md +++ b/base/special/gamma/README.md @@ -121,6 +121,95 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/gamma.h" +``` + +#### stdlib_base_gamma( x ) + +Evaluates the [gamma function][gamma-function]. + +```c +double out = stdlib_base_gamma( 4.0 ); +// returns 6.0 + +out = stdlib_base_gamma( -1.5 ); +// returns ~2.363 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_gamma( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/gamma.h" +#include +#include + +int main( void ) { + const double x[] = { 4.0, -1.5, -0.5, 0.5 }; + + double y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_gamma( x[ i ] ); + printf( "gamma(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +