diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d054fd49..15351e4bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2853,6 +2853,28 @@ This release closes the following issue: +
+ +#### [@stdlib/math/base/special/factorial](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/factorial) + +
+ +
+ +##### Features + +- [`cc98b20`](https://github.com/stdlib-js/stdlib/commit/cc98b20ab91590c526896d547e447f107fc714aa) - add C implementation for `math/base/special/factorial` [(##2618)](#2618 ) + +
+ + + +
+ +
+ + +
#### [@stdlib/math/base/special/factorial2](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/factorial2) @@ -5198,6 +5220,7 @@ A total of 29 people contributed to this release. Thank you to the following con
+- [`cc98b20`](https://github.com/stdlib-js/stdlib/commit/cc98b20ab91590c526896d547e447f107fc714aa) - **feat:** add C implementation for `math/base/special/factorial` [(##2618)](#2618 ) _(by Gunj Joshi)_ - [`1f99cd7`](https://github.com/stdlib-js/stdlib/commit/1f99cd7f06bd5e3027f29c6d816ea39e8624cab1) - **feat:** add C implementation for `math/base/special/floor10` [(##2619)](#2619) _(by Gunj Joshi)_ - [`0d796b2`](https://github.com/stdlib-js/stdlib/commit/0d796b2a86fe0a08d1f3ed1827aaf2ce355f9b4f) - **refactor:** use stdlib APIs and adjust test tolerances _(by Athan Reines)_ - [`d6c4251`](https://github.com/stdlib-js/stdlib/commit/d6c4251492f60d2a3871e679fb67a35c57973056) - **feat:** add C implementation for `math/base/special/sinpi` [(##2610)](#2610) _(by Gunj Joshi)_ diff --git a/base/special/factorial/README.md b/base/special/factorial/README.md index df62c86b6..3b3cec527 100644 --- a/base/special/factorial/README.md +++ b/base/special/factorial/README.md @@ -151,6 +151,94 @@ for ( i = 0; i < x.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/factorial.h" +``` + +#### stdlib_base_factorial( x ) + +Evaluates the [factorial][factorial-function] function. + +```c +double out = stdlib_base_factorial( 3.0 ); +// returns 6.0 + +out = stdlib_base_factorial( -1.5 ); +// returns ~-3.545 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_factorial( const double n ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/factorial.h" +#include + +int main( void ) { + const double x[] = { 2.0, 3.0, 5.0, 8.0 }; + + double y; + int i; + for ( i = 0; i < 4; i++ ) { + y = stdlib_base_factorial( x[ i ] ); + printf( "factorial(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +