JSPM

@stdlib/math-base-special-negafibonaccif

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

Compute the nth negaFibonacci number as a single-precision floating-point number.

Package Exports

  • @stdlib/math-base-special-negafibonaccif
  • @stdlib/math-base-special-negafibonaccif/dist
  • @stdlib/math-base-special-negafibonaccif/dist/index.js
  • @stdlib/math-base-special-negafibonaccif/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-negafibonaccif) 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!

negaFibonaccif

NPM version Build Status Coverage Status

Compute the nth negaFibonacci number as a single-precision floating-point number.

The negaFibonacci numbers are the integer sequence

The sequence is defined by the recurrence relation

which yields

with seed values F_0 = 0 and F_{-1} = 1.

Installation

npm install @stdlib/math-base-special-negafibonaccif

Usage

var negafibonaccif = require( '@stdlib/math-base-special-negafibonaccif' );

negafibonaccif( n )

Computes the nth negaFibonacci number as a single-precision floating-point number.

var v = negafibonaccif( 0 );
// returns 0

v = negafibonaccif( -1 );
// returns 1

v = negafibonaccif( -2 );
// returns -1

v = negafibonaccif( -3 );
// returns 2

v = negafibonaccif( -36 );
// returns -14930352

If n < -36, the function returns NaN, as larger negaFibonacci numbers cannot be safely represented in single-precision floating-point format.

var v = negafibonaccif( -37 );
// returns NaN

If not provided a nonpositive integer value, the function returns NaN.

var v = negafibonaccif( -3.14 );
// returns NaN

v = negafibonaccif( 1 );
// returns NaN

If provided NaN, the function returns NaN.

var v = negafibonaccif( NaN );
// returns NaN

Examples

var logEachMap = require( '@stdlib/console-log-each-map' );
var linspace = require( '@stdlib/array-base-linspace' );
var negafibonaccif = require( '@stdlib/math-base-special-negafibonaccif' );

var v = linspace( -36, 0, 37 );

logEachMap( 'negafibonaccif(%d) = %0.4f', v, negafibonaccif );

C APIs

Usage

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

stdlib_base_negafibonaccif( n )

Computes the nth negaFibonacci number as a single-precision floating-point number.

float out = stdlib_base_negafibonaccif( 0.0f );
// returns 0.0f

out = stdlib_base_negafibonaccif( -1.0f );
// returns 1.0f

The function accepts the following arguments:

  • n: [in] float input value.
float stdlib_base_negafibonaccif( const float n );

Examples

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

int main( void ) {
    float i;
    float v;

    for ( i = 0.0f; i > -37.0f; i-- ) {
        v = stdlib_base_negafibonaccif( i );
        printf( "negafibonaccif(%f) = %f\n", i, v );
    }
}

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.