From fd18c5bbf59fcc2b7ab8b451545969f908a674f0 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 11 Aug 2024 01:48:36 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 4 +- base/special/binomcoefln/README.md | 91 +++++++++- .../binomcoefln/benchmark/benchmark.native.js | 63 +++++++ .../binomcoefln/benchmark/c/native/Makefile | 146 +++++++++++++++ .../benchmark/c/native/benchmark.c | 135 ++++++++++++++ base/special/binomcoefln/binding.gyp | 170 ++++++++++++++++++ base/special/binomcoefln/examples/c/Makefile | 146 +++++++++++++++ base/special/binomcoefln/examples/c/example.c | 34 ++++ base/special/binomcoefln/include.gypi | 53 ++++++ .../stdlib/math/base/special/binomcoefln.h | 40 +++++ base/special/binomcoefln/lib/native.js | 59 ++++++ base/special/binomcoefln/manifest.json | 87 +++++++++ base/special/binomcoefln/src/Makefile | 70 ++++++++ base/special/binomcoefln/src/addon.c | 22 +++ base/special/binomcoefln/src/main.c | 59 ++++++ base/special/binomcoefln/test/test.js | 7 +- base/special/binomcoefln/test/test.native.js | 91 ++++++++++ 17 files changed, 1272 insertions(+), 5 deletions(-) create mode 100644 base/special/binomcoefln/benchmark/benchmark.native.js create mode 100644 base/special/binomcoefln/benchmark/c/native/Makefile create mode 100644 base/special/binomcoefln/benchmark/c/native/benchmark.c create mode 100644 base/special/binomcoefln/binding.gyp create mode 100644 base/special/binomcoefln/examples/c/Makefile create mode 100644 base/special/binomcoefln/examples/c/example.c create mode 100644 base/special/binomcoefln/include.gypi create mode 100644 base/special/binomcoefln/include/stdlib/math/base/special/binomcoefln.h create mode 100644 base/special/binomcoefln/lib/native.js create mode 100644 base/special/binomcoefln/manifest.json create mode 100644 base/special/binomcoefln/src/Makefile create mode 100644 base/special/binomcoefln/src/addon.c create mode 100644 base/special/binomcoefln/src/main.c create mode 100644 base/special/binomcoefln/test/test.native.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a7d3d5f7..49121461e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-08-09) +## Unreleased (2024-08-11)
@@ -893,6 +893,7 @@ This release closes the following issue: ##### Features +- [`5b184b6`](https://github.com/stdlib-js/stdlib/commit/5b184b681a3d1d5c3fea30b9d8f4630c86eb44af) - add C implementation for `math/base/special/binomcoefln` - [`06b8011`](https://github.com/stdlib-js/stdlib/commit/06b80119890e1868578ba4904e9efaa071b27b05) - add C implementation for `math/base/special/binomcoef` - [`6e4b9eb`](https://github.com/stdlib-js/stdlib/commit/6e4b9ebc31d9629446019e37e31bfe9b180b675c) - update namespace TypeScript declarations [(#2681)](https://github.com/stdlib-js/stdlib/pull/2681) - [`c77f866`](https://github.com/stdlib-js/stdlib/commit/c77f866c93006ba4bf73221cb28c94c23195ca06) - add C implementation for `math/base/special/binet` [(#2653)](https://github.com/stdlib-js/stdlib/pull/2653) @@ -5917,6 +5918,7 @@ A total of 30 people contributed to this release. Thank you to the following con
+- [`5b184b6`](https://github.com/stdlib-js/stdlib/commit/5b184b681a3d1d5c3fea30b9d8f4630c86eb44af) - **feat:** add C implementation for `math/base/special/binomcoefln` _(by Gunj Joshi, Philipp Burckhardt)_ - [`b224509`](https://github.com/stdlib-js/stdlib/commit/b2245099fc615230ea5a6d3dd28dc7626634bdab) - **feat:** add `F_I` macro to `math/base/napi/unary` [(#2768)](https://github.com/stdlib-js/stdlib/pull/2768) _(by Gunj Joshi)_ - [`140b517`](https://github.com/stdlib-js/stdlib/commit/140b5172075f08678b84b5f92b7feeacfc777119) - **feat:** add `math/base/assert/is-integerf` _(by Gunj Joshi, Philipp Burckhardt)_ - [`2837436`](https://github.com/stdlib-js/stdlib/commit/283743652091fff85f01746b9edf8da3d5286cf5) - **docs:** update license header in `math/base/special/gamma1pm1` [(#2764)](https://github.com/stdlib-js/stdlib/pull/2764) _(by Gunj Joshi)_ diff --git a/base/special/binomcoefln/README.md b/base/special/binomcoefln/README.md index bcc823735..7b2609456 100644 --- a/base/special/binomcoefln/README.md +++ b/base/special/binomcoefln/README.md @@ -83,7 +83,7 @@ var binomcoefln = require( '@stdlib/math/base/special/binomcoefln' ); #### binomcoefln( n, k ) -Evaluates the [binomial coefficient][binomial-coefficient] of two integers `n` and `k`. +Evaluates the natural logarithm of the [binomial coefficient][binomial-coefficient] of two integers `n` and `k`. ```javascript var v = binomcoefln( 8, 2 ); @@ -158,6 +158,95 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/binomcoefln.h" +``` + +#### stdlib_base_binomcoefln( n, k ) + +Evaluates the natural logarithm of the [binomial coefficient][binomial-coefficient] of two integers `n` and `k`. + +```c +double v = stdlib_base_binomcoefln( 8, 2 ); +// returns ~3.332 +``` + +The function accepts the following arguments: + +- **n**: `[in] int64_t` input value. +- **k**: `[in] int64_t` input value. + +```c +double stdlib_base_binomcoefln( const int64_t n, const int64_t k ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/binomcoefln.h" +#include +#include +#include + +int main( void ) { + const int64_t a[] = { 24, 32, 48, 116, 33 }; + const int64_t b[] = { 12, 6, 15, 52, 22 }; + + double out; + int i; + for ( i = 0; i < 5; i++ ) { + out = stdlib_base_binomcoef( a[ i ], b[ i ] ); + printf( "binomcoefln(%" PRId64 ", %" PRId64 ") = %lf\n", a[ i ], b[ i ], out ); + } +} +``` + +
+ + + +
+ + +