From 5bbc8cc94aec63d0f468d4708edf0848eab4a8de Mon Sep 17 00:00:00 2001 From: Samarth Kolarkar Date: Fri, 23 Jan 2026 17:23:41 +0530 Subject: [PATCH 1/2] fix: update max safe Lucas for float16 to 1364 --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../float16/max-safe-lucas/README.md | 168 ++++++++++++++++++ .../float16/max-safe-lucas/docs/repl.txt | 13 ++ .../max-safe-lucas/docs/types/index.d.ts | 33 ++++ .../float16/max-safe-lucas/docs/types/test.ts | 28 +++ .../float16/max-safe-lucas/examples/index.js | 51 ++++++ .../stdlib/constants/float16/max_safe_lucas.h | 27 +++ .../float16/max-safe-lucas/lib/index.js | 49 +++++ .../float16/max-safe-lucas/manifest.json | 36 ++++ .../float16/max-safe-lucas/package.json | 71 ++++++++ .../float16/max-safe-lucas/test/test.js | 38 ++++ 10 files changed, 514 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/float16/max-safe-lucas/README.md create mode 100644 lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/constants/float16/max-safe-lucas/examples/index.js create mode 100644 lib/node_modules/@stdlib/constants/float16/max-safe-lucas/include/stdlib/constants/float16/max_safe_lucas.h create mode 100644 lib/node_modules/@stdlib/constants/float16/max-safe-lucas/lib/index.js create mode 100644 lib/node_modules/@stdlib/constants/float16/max-safe-lucas/manifest.json create mode 100644 lib/node_modules/@stdlib/constants/float16/max-safe-lucas/package.json create mode 100644 lib/node_modules/@stdlib/constants/float16/max-safe-lucas/test/test.js diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/README.md b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/README.md new file mode 100644 index 000000000000..3db79610dfe4 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/README.md @@ -0,0 +1,168 @@ + + +# FLOAT16_MAX_SAFE_LUCAS + +> Maximum safe [Lucas number][lucas-number] when stored in [half-precision floating-point][ieee754] format. + +
+ +## Usage + +```javascript +var FLOAT16_MAX_SAFE_LUCAS = require( '@stdlib/constants/float16/max-safe-lucas' ); +``` + +#### FLOAT16_MAX_SAFE_LUCAS + +The maximum [safe][safe-integers] [Lucas number][lucas-number] when stored in [half-precision floating-point][ieee754] format. + +```javascript +var bool = ( FLOAT16_MAX_SAFE_LUCAS === 1364 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + +```javascript +var FLOAT16_MAX_SAFE_LUCAS = require( '@stdlib/constants/float16/max-safe-lucas' ); + +function lucas( n ) { + var a; + var b; + var c; + var i; + + a = 2; + if ( n === 0 ) { + return a; + } + b = 1; + for ( i = 2; i <= n; i++ ) { + c = a + b; + a = b; + b = c; + } + return b; +} + +var v; +var i; +for ( i = 0; i < 100; i++ ) { + v = lucas( i ); + if ( v > FLOAT16_MAX_SAFE_LUCAS ) { + console.log( 'Unsafe: %d', v ); + } else { + console.log( 'Safe: %d', v ); + } +} +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float16/max_safe_lucas.h" +``` + +#### STDLIB_CONSTANT_FLOAT16_MAX_SAFE_LUCAS + +Macro for the maximum [safe][safe-integers] [Lucas number][lucas-number] when stored in [half-precision floating-point][ieee754] format. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/repl.txt b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/repl.txt new file mode 100644 index 000000000000..716cf1217179 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/repl.txt @@ -0,0 +1,13 @@ + +{{alias}} + Maximum safe Lucas number when stored in half-precision floating-point + format. + + Examples + -------- + > {{alias}} + 1364 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/index.d.ts new file mode 100644 index 000000000000..caec27d14970 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/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 Lucas number when stored in half-precision floating-point format. +* +* @example +* var max = FLOAT16_MAX_SAFE_LUCAS; +* // returns 1364 +*/ +declare const FLOAT16_MAX_SAFE_LUCAS: number; + + +// EXPORTS // + +export = FLOAT16_MAX_SAFE_LUCAS; diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/test.ts new file mode 100644 index 000000000000..b86d41a297ac --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/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 FLOAT16_MAX_SAFE_LUCAS = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT16_MAX_SAFE_LUCAS; // $ExpectType number +} diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/examples/index.js b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/examples/index.js new file mode 100644 index 000000000000..5bb91dc38e5c --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/examples/index.js @@ -0,0 +1,51 @@ +/** +* @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 FLOAT16_MAX_SAFE_LUCAS = require( './../lib' ); + +function lucas( n ) { + var a; + var b; + var c; + var i; + + a = 2; + if ( n === 0 ) { + return a; + } + b = 1; + for ( i = 2; i <= n; i++ ) { + c = a + b; + a = b; + b = c; + } + return b; +} + +var v; +var i; +for ( i = 0; i < 100; i++ ) { + v = lucas( i ); + if ( v > FLOAT16_MAX_SAFE_LUCAS ) { + console.log( 'Unsafe: %d', v ); + } else { + console.log( 'Safe: %d', v ); + } +} diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/include/stdlib/constants/float16/max_safe_lucas.h b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/include/stdlib/constants/float16/max_safe_lucas.h new file mode 100644 index 000000000000..6141d082f9c1 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/include/stdlib/constants/float16/max_safe_lucas.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_FLOAT16_MAX_SAFE_LUCAS_H +#define STDLIB_CONSTANTS_FLOAT16_MAX_SAFE_LUCAS_H + +/** +* Macro for the maximum safe Lucas number when stored in half-precision floating-point format. +*/ +#define STDLIB_CONSTANT_FLOAT16_MAX_SAFE_LUCAS 1364 + +#endif // !STDLIB_CONSTANTS_FLOAT16_MAX_SAFE_LUCAS_H diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/lib/index.js b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/lib/index.js new file mode 100644 index 000000000000..ad87a81ed3b7 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/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 Lucas number when stored in half-precision floating-point format. +* +* @module @stdlib/constants/float16/max-safe-lucas +* @type {integer} +* +* @example +* var FLOAT16_MAX_SAFE_LUCAS = require( '@stdlib/constants/float16/max-safe-lucas' ); +* // returns 1364 +*/ + + +// MAIN // + +/** +* The maximum safe Lucas number when stored in half-precision floating-point format. +* +* @constant +* @type {integer} +* @default 1364 +* @see [Lucas number]{@link https://en.wikipedia.org/wiki/Lucas_number} +* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985} +*/ +var FLOAT16_MAX_SAFE_LUCAS = 1364; + + +// EXPORTS // + +module.exports = FLOAT16_MAX_SAFE_LUCAS; diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/manifest.json b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/manifest.json new file mode 100644 index 000000000000..844d692f6439 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/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/float16/max-safe-lucas/package.json b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/package.json new file mode 100644 index 000000000000..88d703c5cbed --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/package.json @@ -0,0 +1,71 @@ +{ + "name": "@stdlib/constants/float16/max-safe-lucas", + "version": "0.0.0", + "description": "Maximum safe Lucas number when stored in half-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", + "lucas", + "fibonacci", + "number", + "fib", + "safe", + "integer", + "floating", + "point", + "floating-point", + "float", + "float16", + "ieee754" + ] +} diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/test/test.js b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/test/test.js new file mode 100644 index 000000000000..f3ee1a925fef --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/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 FLOAT16_MAX_SAFE_LUCAS = require( './../lib' ); + + +// TESTS // + +tape('main export is a number', function test(t) { + t.ok(true, __filename); + t.strictEqual(typeof FLOAT16_MAX_SAFE_LUCAS, 'number', 'main export is a number'); + t.end(); +}); + +tape('the exported value is 1364', function test(t) { + t.strictEqual(FLOAT16_MAX_SAFE_LUCAS, 1364, 'returns expected value'); + t.end(); +}); From b2d7949fb5b1bb94277f7dddc12c8e95609a8020 Mon Sep 17 00:00:00 2001 From: Samarth Kolarkar Date: Fri, 23 Jan 2026 19:40:43 +0530 Subject: [PATCH 2/2] chore: update copyright year to 2026 --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../@stdlib/constants/float16/max-safe-lucas/README.md | 2 +- .../constants/float16/max-safe-lucas/docs/types/index.d.ts | 2 +- .../@stdlib/constants/float16/max-safe-lucas/docs/types/test.ts | 2 +- .../@stdlib/constants/float16/max-safe-lucas/examples/index.js | 2 +- .../include/stdlib/constants/float16/max_safe_lucas.h | 2 +- .../@stdlib/constants/float16/max-safe-lucas/lib/index.js | 2 +- .../@stdlib/constants/float16/max-safe-lucas/test/test.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/README.md b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/README.md index 3db79610dfe4..94da0937dc44 100644 --- a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/README.md +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2025 The Stdlib Authors. +Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/index.d.ts index caec27d14970..731799731082 100644 --- a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/index.d.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/test.ts index b86d41a297ac..53403606966c 100644 --- a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/test.ts +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/docs/types/test.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/examples/index.js b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/examples/index.js index 5bb91dc38e5c..fb948dce74e8 100644 --- a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/examples/index.js +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/include/stdlib/constants/float16/max_safe_lucas.h b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/include/stdlib/constants/float16/max_safe_lucas.h index 6141d082f9c1..fb6ba39a3e83 100644 --- a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/include/stdlib/constants/float16/max_safe_lucas.h +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/include/stdlib/constants/float16/max_safe_lucas.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/lib/index.js b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/lib/index.js index ad87a81ed3b7..1ce1612b7fcf 100644 --- a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/lib/index.js +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/test/test.js b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/test/test.js index f3ee1a925fef..411e8e60d616 100644 --- a/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/test/test.js +++ b/lib/node_modules/@stdlib/constants/float16/max-safe-lucas/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 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.