diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/README.md b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/README.md new file mode 100644 index 000000000000..1c3017b6ccb1 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/README.md @@ -0,0 +1,183 @@ + + +# FLOAT32_MAX_SAFE_NTH_TRIBONACCI + +> Maximum safe nth [Tribonacci number][tribonacci-number] when stored in [single-precision floating-point][ieee754] format. + +
+ +## Usage + + + +```javascript +var FLOAT32_MAX_SAFE_NTH_TRIBONACCI = require( '@stdlib/constants/float32/max-safe-nth-tribonacci' ); +``` + +#### FLOAT32_MAX_SAFE_NTH_TRIBONACCI + +Maximum [safe][safe-integers] nth [Tribonacci number][tribonacci-number] when stored in [single-precision floating-point][ieee754] format. + + + +```javascript +var bool = ( FLOAT32_MAX_SAFE_NTH_TRIBONACCI === 30 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + + + +```javascript +var FLOAT32_MAX_SAFE_NTH_TRIBONACCI = require( '@stdlib/constants/float32/max-safe-nth-tribonacci' ); + +function tribonacci( n ) { + var a; + var b; + var c; + var d; + var i; + + a = 0; + b = 0; + c = 1; + if ( n === 0 ) { + return a; + } + if ( n === 1 ) { + return b; + } + if ( n === 2 ) { + return c; + } + for ( i = 3; i <= n; i++ ) { + d = a + b + c; + a = b; + b = c; + c = d; + } + return c; +} + +var v; +var i; +for ( i = 0; i < 100; i++ ) { + v = tribonacci( i ); + if ( i > FLOAT32_MAX_SAFE_NTH_TRIBONACCI ) { + console.log( 'Unsafe: %d', v ); + } else { + console.log( 'Safe: %d', v ); + } +} +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float32/max_safe_nth_tribonacci.h" +``` + +#### STDLIB_CONSTANT_FLOAT32_MAX_SAFE_NTH_TRIBONACCI + +Maximum [safe][safe-integers] nth [Tribonacci number][tribonacci-number] when stored in [single-precision floating-point][ieee754] format. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/docs/repl.txt b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/docs/repl.txt new file mode 100644 index 000000000000..6b3aa08868bf --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/docs/repl.txt @@ -0,0 +1,13 @@ + +{{alias}} + Maximum safe nth Tribonacci number when stored in single-precision + floating-point format. + + Examples + -------- + > {{alias}} + 30 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/docs/types/index.d.ts new file mode 100644 index 000000000000..f7713f5d9edb --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/docs/types/index.d.ts @@ -0,0 +1,33 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Maximum safe nth Tribonacci number when stored in single-precision floating-point format. +* +* @example +* var max = FLOAT32_MAX_SAFE_NTH_TRIBONACCI; +* // returns 30 +*/ +declare const FLOAT32_MAX_SAFE_NTH_TRIBONACCI: number; + + +// EXPORTS // + +export = FLOAT32_MAX_SAFE_NTH_TRIBONACCI; diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/docs/types/test.ts new file mode 100644 index 000000000000..254b7f07546a --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/docs/types/test.ts @@ -0,0 +1,28 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import FLOAT32_MAX_SAFE_NTH_TRIBONACCI = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT32_MAX_SAFE_NTH_TRIBONACCI; // $ExpectType number +} diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/examples/index.js b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/examples/index.js new file mode 100644 index 000000000000..55409e4b750e --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/examples/index.js @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var FLOAT32_MAX_SAFE_NTH_TRIBONACCI = require( './../lib' ); // eslint-disable-line id-length + +function tribonacci( n ) { + var a; + var b; + var c; + var d; + var i; + + a = 0; + b = 0; + c = 1; + if ( n === 0 ) { + return a; + } + if ( n === 1 ) { + return b; + } + if ( n === 2 ) { + return c; + } + for ( i = 3; i <= n; i++ ) { + d = a + b + c; + a = b; + b = c; + c = d; + } + return c; +} + +var v; +var i; +for ( i = 0; i < 100; i++ ) { + v = tribonacci( i ); + if ( i > FLOAT32_MAX_SAFE_NTH_TRIBONACCI ) { + console.log( 'Unsafe: %d', v ); + } else { + console.log( 'Safe: %d', v ); + } +} diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/include/stdlib/constants/float32/max_safe_nth_tribonacci.h b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/include/stdlib/constants/float32/max_safe_nth_tribonacci.h new file mode 100644 index 000000000000..957bf483f6c8 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/include/stdlib/constants/float32/max_safe_nth_tribonacci.h @@ -0,0 +1,27 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#ifndef STDLIB_CONSTANTS_FLOAT32_MAX_SAFE_NTH_TRIBONACCI_H +#define STDLIB_CONSTANTS_FLOAT32_MAX_SAFE_NTH_TRIBONACCI_H + +/** +* Maximum safe nth Tribonacci number when stored in single-precision floating-point format. +*/ +#define STDLIB_CONSTANT_FLOAT32_MAX_SAFE_NTH_TRIBONACCI 30 + +#endif // !STDLIB_CONSTANTS_FLOAT32_MAX_SAFE_NTH_TRIBONACCI_H diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/lib/index.js b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/lib/index.js new file mode 100644 index 000000000000..f014349f60df --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/lib/index.js @@ -0,0 +1,49 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Maximum safe nth Tribonacci number when stored in single-precision floating-point format. +* +* @module @stdlib/constants/float32/max-safe-nth-tribonacci +* @type {integer} +* +* @example +* var FLOAT32_MAX_SAFE_NTH_TRIBONACCI = require( '@stdlib/constants/float32/max-safe-nth-tribonacci' ); +* // returns 30 +*/ + + +// MAIN // + +/** +* Maximum safe nth Tribonacci number when stored in single-precision floating-point format. +* +* @constant +* @type {integer} +* @default 30 +* @see [Tribonacci number]{@link https://en.wikipedia.org/wiki/Tribonacci_number} +* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985} +*/ +var FLOAT32_MAX_SAFE_NTH_TRIBONACCI = 30|0; // eslint-disable-line id-length + + +// EXPORTS // + +module.exports = FLOAT32_MAX_SAFE_NTH_TRIBONACCI; diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/manifest.json b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/manifest.json new file mode 100644 index 000000000000..844d692f6439 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/manifest.json @@ -0,0 +1,36 @@ +{ + "options": {}, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "src": [], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [] + } + ] +} diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/package.json b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/package.json new file mode 100644 index 000000000000..6c52d8ecc251 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/package.json @@ -0,0 +1,71 @@ +{ + "name": "@stdlib/constants/float32/max-safe-nth-tribonacci", + "version": "0.0.0", + "description": "Maximum safe nth Tribonacci number when stored in single-precision floating-point format.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "constant", + "const", + "max", + "maximum", + "tribonacci", + "number", + "trib", + "safe", + "integer", + "floating", + "point", + "floating-point", + "float", + "float32", + "f32", + "ieee754" + ] +} diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/test/test.js b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/test/test.js new file mode 100644 index 000000000000..0cbaae5d271e --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-nth-tribonacci/test/test.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var FLOAT32_MAX_SAFE_NTH_TRIBONACCI = require( './../lib' ); // eslint-disable-line id-length + + +// TESTS // + +tape( 'main export is a number', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof FLOAT32_MAX_SAFE_NTH_TRIBONACCI, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'the exported value is 30', function test( t ) { + t.strictEqual( FLOAT32_MAX_SAFE_NTH_TRIBONACCI, 30, 'returns expected value' ); + t.end(); +});