<commit_before>'use strict';

// MODULES //

var isnan = require( '@stdlib/math/base/assert/is-nan' );
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_FIBONACCI = require( '@stdlib/math/constants/float64-max-safe-nth-fibonacci' );
var FIBONACCI = require( './fibonacci.json' );


// MAIN //

/**
* Computes the nth Fibonacci number.
*
* @param {integer} n - the Fibonacci number to compute
* @returns {integer} Fibonacci number
*
* @example
* var y = fibonacci( 0 );
* // returns 0
*
* @example
* var y = fibonacci( 1 );
* // returns 1
*
* @example
* var y = fibonacci( 2 );
* // returns 1
*
* @example
* var y = fibonacci( 3 );
* // returns 2
*
* @example
* var y = fibonacci( 4 );
* // returns 3
*
* @example
* var y = fibonacci( 5 );
* // returns 5
*
* @example
* var y = fibonacci( 6 );
* // returns 8
*
* @example
* var y = fibonacci( NaN );
* // returns NaN
*
* @example
* var y = fibonacci( 3.14 );
* // returns NaN
*
* @example
* var y = fibonacci( -1.0 );
* // returns NaN
*/
function fibonacci( n ) {
	if (
		isnan( n ) ||
		isInteger( n ) === false ||
		n < 0 ||
		n > MAX_FIBONACCI
	) {
		return NaN;
	}
	return FIBONACCI[ n ];
} // end FUNCTION fibonacci()


// EXPORTS //

module.exports = fibonacci;
<commit_msg>Update type annotations<commit_after>'use strict';

// MODULES //

var isnan = require( '@stdlib/math/base/assert/is-nan' );
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var MAX_FIBONACCI = require( '@stdlib/math/constants/float64-max-safe-nth-fibonacci' );
var FIBONACCI = require( './fibonacci.json' );


// MAIN //

/**
* Computes the nth Fibonacci number.
*
* @param {NonNegativeInteger} n - the Fibonacci number to compute
* @returns {NonNegativeInteger} Fibonacci number
*
* @example
* var y = fibonacci( 0 );
* // returns 0
*
* @example
* var y = fibonacci( 1 );
* // returns 1
*
* @example
* var y = fibonacci( 2 );
* // returns 1
*
* @example
* var y = fibonacci( 3 );
* // returns 2
*
* @example
* var y = fibonacci( 4 );
* // returns 3
*
* @example
* var y = fibonacci( 5 );
* // returns 5
*
* @example
* var y = fibonacci( 6 );
* // returns 8
*
* @example
* var y = fibonacci( NaN );
* // returns NaN
*
* @example
* var y = fibonacci( 3.14 );
* // returns NaN
*
* @example
* var y = fibonacci( -1.0 );
* // returns NaN
*/
function fibonacci( n ) {
	if (
		isnan( n ) ||
		isInteger( n ) === false ||
		n < 0 ||
		n > MAX_FIBONACCI
	) {
		return NaN;
	}
	return FIBONACCI[ n ];
} // end FUNCTION fibonacci()


// EXPORTS //

module.exports = fibonacci;

{'fraction_non_alphanumeric': 0.18045705279747834, 'fraction_numerical': 0.017336485421591805, 'mean_word_length': 2.900153609831029, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3751649', 'n_tokens_mistral': 1060, 'n_tokens_neox': 986, 'n_words': 264}