From 9d5294e092af54feeb4b45e5bad99a0cf25ffcf9 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 29 May 2024 00:03:15 +0000 Subject: [PATCH] Auto-generated commit --- base/special/fibonacci-index/README.md | 88 +++++++++ .../benchmark/benchmark.native.js | 67 +++++++ .../benchmark/c/native/Makefile | 146 +++++++++++++++ .../benchmark/c/native/benchmark.c | 136 ++++++++++++++ base/special/fibonacci-index/binding.gyp | 170 ++++++++++++++++++ .../fibonacci-index/examples/c/Makefile | 146 +++++++++++++++ .../fibonacci-index/examples/c/example.c | 31 ++++ base/special/fibonacci-index/include.gypi | 53 ++++++ .../math/base/special/fibonacci_index.h | 38 ++++ base/special/fibonacci-index/lib/native.js | 78 ++++++++ base/special/fibonacci-index/manifest.json | 87 +++++++++ base/special/fibonacci-index/src/Makefile | 70 ++++++++ base/special/fibonacci-index/src/addon.c | 23 +++ base/special/fibonacci-index/src/main.c | 51 ++++++ .../fibonacci-index/test/test.native.js | 88 +++++++++ 15 files changed, 1272 insertions(+) create mode 100644 base/special/fibonacci-index/benchmark/benchmark.native.js create mode 100644 base/special/fibonacci-index/benchmark/c/native/Makefile create mode 100644 base/special/fibonacci-index/benchmark/c/native/benchmark.c create mode 100644 base/special/fibonacci-index/binding.gyp create mode 100644 base/special/fibonacci-index/examples/c/Makefile create mode 100644 base/special/fibonacci-index/examples/c/example.c create mode 100644 base/special/fibonacci-index/include.gypi create mode 100644 base/special/fibonacci-index/include/stdlib/math/base/special/fibonacci_index.h create mode 100644 base/special/fibonacci-index/lib/native.js create mode 100644 base/special/fibonacci-index/manifest.json create mode 100644 base/special/fibonacci-index/src/Makefile create mode 100644 base/special/fibonacci-index/src/addon.c create mode 100644 base/special/fibonacci-index/src/main.c create mode 100644 base/special/fibonacci-index/test/test.native.js diff --git a/base/special/fibonacci-index/README.md b/base/special/fibonacci-index/README.md index c0f7384aa..831d816e0 100644 --- a/base/special/fibonacci-index/README.md +++ b/base/special/fibonacci-index/README.md @@ -125,6 +125,94 @@ for ( i = 3; i < 79; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/fibonacci_index.h" +``` + +#### stdlib_base_fibonacci_index( F ) + +Compute the [Fibonacci number][fibonacci-number] index. + +```c +double out = stdlib_base_fibonacci( 2 ); +// returns 3 + +out = stdlib_base_fibonacci( 3 ); +// returns 4 +``` + +The function accepts the following arguments: + +- **n**: `[in] double` input value. + +```c +double stdlib_base_fibonacci( const double F ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/fibonacci_index.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_fibonacci_index( x[ i ] ); + printf( "fibonacci_index(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +