JSPM

@stdlib/math-base-special-fibonacci-indexf

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 31
  • Score
    100M100P100Q81037F
  • License Apache-2.0

Compute the Fibonacci number index of a single-precision floating-point number.

Package Exports

  • @stdlib/math-base-special-fibonacci-indexf
  • @stdlib/math-base-special-fibonacci-indexf/dist
  • @stdlib/math-base-special-fibonacci-indexf/dist/index.js
  • @stdlib/math-base-special-fibonacci-indexf/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stdlib/math-base-special-fibonacci-indexf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

About stdlib...

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!

Fibonacci Number Index

NPM version Build Status Coverage Status

Compute the Fibonacci number index of a single-precision floating-point number.

The Fibonacci number index is given by

where φ is the golden ratio and F > 1.

Installation

npm install @stdlib/math-base-special-fibonacci-indexf

Usage

var fibonacciIndexf = require( '@stdlib/math-base-special-fibonacci-indexf' );

fibonacciIndexf( F )

Computes the Fibonacci number index of a single-precision floating-point number.

var n = fibonacciIndexf( 2 );
// returns 3

n = fibonacciIndexf( 3 );
// returns 4

n = fibonacciIndexf( 5 );
// returns 5

If provided either a non-integer or F_n <= 1, the function returns NaN.

var n = fibonacciIndexf( -1 );
// returns NaN

n = fibonacciIndexf( 3.14 );
// returns NaN

If provided NaN, the function returns NaN.

var n = fibonacciIndexf( NaN );
// returns NaN

Examples

var fibonacciIndexf = require( '@stdlib/math-base-special-fibonacci-indexf' );

var F1;
var F2;
var FN;
var n;
var i;

F1 = 1;
F2 = 1;
for ( i = 3; i < 37; i++ ) {
    FN = F1 + F2;
    F1 = F2;
    F2 = FN;
    n = fibonacciIndexf( FN );
    console.log( 'n(%d) = %d', FN, n );
}

C APIs

Usage

#include "stdlib/math/base/special/fibonacci_indexf.h"

stdlib_base_fibonacci_indexf( F )

Computes the Fibonacci number index of a single-precision floating-point number.

float out = stdlib_base_fibonacci_indexf( 2.0f );
// returns 3.0f

out = stdlib_base_fibonacci_indexf( 3.0f );
// returns 4.0f

The function accepts the following arguments:

  • F: [in] float input value.
float stdlib_base_fibonacci_indexf( const float F );

Examples

#include "stdlib/math/base/special/fibonacci_indexf.h"
#include <stdio.h>

int main( void ) {
    const float x[] = { 2.0f, 3.0f, 5.0f, 8.0f };

    float y;
    int i;
    for ( i = 0; i < 4; i++ ) {
        y = stdlib_base_fibonacci_indexf( x[ i ] );
        printf( "fibonacci_indexf(%f) = %f\n", x[ i ], y );
    }
}

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright © 2016-2026. The Stdlib Authors.