From f5a25318962b7429e27295dd0ea76bd55aebc6a1 Mon Sep 17 00:00:00 2001 From: hrshya Date: Tue, 25 Mar 2025 21:53:31 +0530 Subject: [PATCH 1/4] feat: add constants/float32/max-safe-lucas --- .../float32/max-safe-lucas/README.md | 165 ++++++++++++++++++ .../float32/max-safe-lucas/docs/repl.txt | 12 ++ .../max-safe-lucas/docs/types/index.d.ts | 33 ++++ .../float32/max-safe-lucas/docs/types/test.ts | 28 +++ .../float32/max-safe-lucas/examples/index.js | 52 ++++++ .../stdlib/constants/float32/max_safe_lucas.h | 27 +++ .../float32/max-safe-lucas/lib/index.js | 49 ++++++ .../float32/max-safe-lucas/manifest.json | 36 ++++ .../float32/max-safe-lucas/package.json | 73 ++++++++ .../float32/max-safe-lucas/test/test.js | 38 ++++ 10 files changed, 513 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md create mode 100644 lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/constants/float32/max-safe-lucas/examples/index.js create mode 100644 lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h create mode 100644 lib/node_modules/@stdlib/constants/float32/max-safe-lucas/lib/index.js create mode 100644 lib/node_modules/@stdlib/constants/float32/max-safe-lucas/manifest.json create mode 100644 lib/node_modules/@stdlib/constants/float32/max-safe-lucas/package.json create mode 100644 lib/node_modules/@stdlib/constants/float32/max-safe-lucas/test/test.js diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md new file mode 100644 index 000000000000..7c5838edc65a --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md @@ -0,0 +1,165 @@ + + +# FLOAT32_MAX_SAFE_LUCAS + +> Maximum safe [Lucas number][lucas-number] when stored in [single-precision floating-point][ieee754] format. + +
+ +## Usage + +```javascript +var FLOAT32_MAX_SAFE_LUCAS = require( '@stdlib/constants/float32/max-safe-lucas' ); +``` + +#### FLOAT32_MAX_SAFE_LUCAS + +The maximum [safe][safe-integers] [Lucas number][lucas-number] when stored in [single-precision floating-point][ieee754] format. + +```javascript +var bool = ( FLOAT32_MAX_SAFE_LUCAS === 1197222447 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + +```javascript +var FLOAT32_MAX_SAFE_LUCAS = require( '@stdlib/constants/float32/max-safe-lucas' ); + +var v; +var i; + +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; +} + +for ( i = 0; i < 100; i++ ) { + v = lucas( i ); + if ( v > FLOAT32_MAX_SAFE_LUCAS ) { + console.log( 'Unsafe: %d', v ); + } else { + console.log( 'Safe: %d', v ); + } +} +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float32/max_safe_lucas.h" +``` + +#### STDLIB_CONSTANT_FLOAT32_MAX_SAFE_LUCAS + +Macro for the maximum [safe][safe-integers] [Lucas number][lucas-number] when stored in [single-precision floating-point][ieee754] format. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/repl.txt b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/repl.txt new file mode 100644 index 000000000000..bec2ec37ece0 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/repl.txt @@ -0,0 +1,12 @@ + +{{alias}} + Maximum safe Lucas number when stored in single-precision floating-point + format. + + Examples + -------- + > {{alias}} + 1197222447 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/types/index.d.ts new file mode 100644 index 000000000000..e5a72ad55c53 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/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 single-precision floating-point format. +* +* @example +* var max = FLOAT32_MAX_SAFE_LUCAS; +* // returns 1197222447 +*/ +declare const FLOAT32_MAX_SAFE_LUCAS: number; + + +// EXPORTS // + +export = FLOAT32_MAX_SAFE_LUCAS; diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/types/test.ts new file mode 100644 index 000000000000..3148bc667d37 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/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 FLOAT32_MAX_SAFE_LUCAS = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT32_MAX_SAFE_LUCAS; // $ExpectType number +} diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/examples/index.js b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/examples/index.js new file mode 100644 index 000000000000..76f58c2b49d8 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/examples/index.js @@ -0,0 +1,52 @@ +/** +* @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_LUCAS = require( './../lib' ); + +var v; +var i; + +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; +} + +for ( i = 0; i < 100; i++ ) { + v = lucas( i ); + if ( v > FLOAT32_MAX_SAFE_LUCAS ) { + console.log( 'Unsafe: %d', v ); + } else { + console.log( 'Safe: %d', v ); + } +} diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h new file mode 100644 index 000000000000..4f80e299efe9 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/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_FLOAT32_MAX_SAFE_LUCAS_H +#define STDLIB_CONSTANTS_FLOAT32_MAX_SAFE_LUCAS_H + +/** +* Macro for the maximum safe Lucas number when stored in single-precision floating-point format. +*/ +#define STDLIB_CONSTANT_FLOAT32_MAX_SAFE_LUCAS 1197222447f + +#endif // !STDLIB_CONSTANTS_FLOAT32_MAX_SAFE_LUCAS_H diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/lib/index.js b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/lib/index.js new file mode 100644 index 000000000000..e5a1dd10b7e1 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/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 single-precision floating-point format. +* +* @module @stdlib/constants/float32/max-safe-lucas +* @type {integer} +* +* @example +* var FLOAT32_MAX_SAFE_LUCAS = require( '@stdlib/constants/float32/max-safe-lucas' ); +* // returns 1197222447 +*/ + + +// MAIN // + +/** +* The maximum safe Lucas number when stored in single-precision floating-point format. +* +* @constant +* @type {integer} +* @default 1197222447 +* @see [Lucas number]{@link https://en.wikipedia.org/wiki/Lucas_number} +* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985} +*/ +var FLOAT32_MAX_SAFE_LUCAS = 1197222447; + + +// EXPORTS // + +module.exports = FLOAT32_MAX_SAFE_LUCAS; diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/manifest.json b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/manifest.json new file mode 100644 index 000000000000..844d692f6439 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/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/float32/max-safe-lucas/package.json b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/package.json new file mode 100644 index 000000000000..d3ae9f1847db --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/package.json @@ -0,0 +1,73 @@ +{ + "name": "@stdlib/constants/float32/max-safe-lucas", + "version": "0.0.0", + "description": "Maximum safe Lucas 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", + "lucas", + "fibonacci", + "number", + "fib", + "safe", + "integer", + "dbl", + "floating", + "point", + "floating-point", + "float", + "float32", + "f64", + "ieee754" + ] +} diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/test/test.js b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/test/test.js new file mode 100644 index 000000000000..ac6cb6d9036d --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/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 FLOAT32_MAX_SAFE_LUCAS = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a number', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof FLOAT32_MAX_SAFE_LUCAS, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'the exported value is 1197222447', function test( t ) { + t.strictEqual( FLOAT32_MAX_SAFE_LUCAS, 1197222447, 'returns expected value' ); + t.end(); +}); From f39b4f36d804e1f661c2149ed5655e10f880cd7d Mon Sep 17 00:00:00 2001 From: hrshya Date: Wed, 26 Mar 2025 21:43:29 +0530 Subject: [PATCH 2/4] fix: fixes suggested changes --- .../@stdlib/constants/float32/max-safe-lucas/README.md | 2 +- .../@stdlib/constants/float32/max-safe-lucas/docs/repl.txt | 2 +- .../constants/float32/max-safe-lucas/docs/types/index.d.ts | 2 +- .../include/stdlib/constants/float32/max_safe_lucas.h | 2 +- .../@stdlib/constants/float32/max-safe-lucas/lib/index.js | 6 +++--- .../@stdlib/constants/float32/max-safe-lucas/test/test.js | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md index 7c5838edc65a..5750ca3f34a7 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md @@ -35,7 +35,7 @@ var FLOAT32_MAX_SAFE_LUCAS = require( '@stdlib/constants/float32/max-safe-lucas' The maximum [safe][safe-integers] [Lucas number][lucas-number] when stored in [single-precision floating-point][ieee754] format. ```javascript -var bool = ( FLOAT32_MAX_SAFE_LUCAS === 1197222447 ); +var bool = ( FLOAT32_MAX_SAFE_LUCAS === 12752043 ); // returns true ``` diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/repl.txt b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/repl.txt index bec2ec37ece0..a2f8bae144c8 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/repl.txt +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/repl.txt @@ -6,7 +6,7 @@ Examples -------- > {{alias}} - 1197222447 + 12752043 See Also -------- diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/types/index.d.ts index e5a72ad55c53..b60246e7e198 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/docs/types/index.d.ts @@ -23,7 +23,7 @@ * * @example * var max = FLOAT32_MAX_SAFE_LUCAS; -* // returns 1197222447 +* // returns 12752043 */ declare const FLOAT32_MAX_SAFE_LUCAS: number; diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h index 4f80e299efe9..f74f3eebb252 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h @@ -22,6 +22,6 @@ /** * Macro for the maximum safe Lucas number when stored in single-precision floating-point format. */ -#define STDLIB_CONSTANT_FLOAT32_MAX_SAFE_LUCAS 1197222447f +#define STDLIB_CONSTANT_FLOAT32_MAX_SAFE_LUCAS 12752043f #endif // !STDLIB_CONSTANTS_FLOAT32_MAX_SAFE_LUCAS_H diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/lib/index.js b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/lib/index.js index e5a1dd10b7e1..731d2c411232 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/lib/index.js +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/lib/index.js @@ -26,7 +26,7 @@ * * @example * var FLOAT32_MAX_SAFE_LUCAS = require( '@stdlib/constants/float32/max-safe-lucas' ); -* // returns 1197222447 +* // returns 12752043 */ @@ -37,11 +37,11 @@ * * @constant * @type {integer} -* @default 1197222447 +* @default 12752043 * @see [Lucas number]{@link https://en.wikipedia.org/wiki/Lucas_number} * @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985} */ -var FLOAT32_MAX_SAFE_LUCAS = 1197222447; +var FLOAT32_MAX_SAFE_LUCAS = 12752043; // EXPORTS // diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/test/test.js b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/test/test.js index ac6cb6d9036d..4dd20d9f988b 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/test/test.js +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/test/test.js @@ -32,7 +32,7 @@ tape( 'main export is a number', function test( t ) { t.end(); }); -tape( 'the exported value is 1197222447', function test( t ) { - t.strictEqual( FLOAT32_MAX_SAFE_LUCAS, 1197222447, 'returns expected value' ); +tape( 'the exported value is 12752043', function test( t ) { + t.strictEqual( FLOAT32_MAX_SAFE_LUCAS, 12752043, 'returns expected value' ); t.end(); }); From 6fcb4dca82dbb09ea8494d9c16209d682475d8b9 Mon Sep 17 00:00:00 2001 From: Gunj Joshi Date: Wed, 2 Apr 2025 23:10:04 +0530 Subject: [PATCH 3/4] Apply suggestions from code review Signed-off-by: Gunj Joshi --- .../@stdlib/constants/float32/max-safe-lucas/README.md | 4 ++++ .../include/stdlib/constants/float32/max_safe_lucas.h | 2 +- .../@stdlib/constants/float32/max-safe-lucas/package.json | 2 -- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md index 5750ca3f34a7..d74eee57ddcd 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md @@ -160,6 +160,10 @@ Macro for the maximum [safe][safe-integers] [Lucas number][lucas-number] when st [ieee754]: https://en.wikipedia.org/wiki/IEEE_754-1985 + + + + diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h index f74f3eebb252..575ba5ab94bb 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/include/stdlib/constants/float32/max_safe_lucas.h @@ -22,6 +22,6 @@ /** * Macro for the maximum safe Lucas number when stored in single-precision floating-point format. */ -#define STDLIB_CONSTANT_FLOAT32_MAX_SAFE_LUCAS 12752043f +#define STDLIB_CONSTANT_FLOAT32_MAX_SAFE_LUCAS 12752043 #endif // !STDLIB_CONSTANTS_FLOAT32_MAX_SAFE_LUCAS_H diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/package.json b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/package.json index d3ae9f1847db..0efd00ec8fe4 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/package.json +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/package.json @@ -61,13 +61,11 @@ "fib", "safe", "integer", - "dbl", "floating", "point", "floating-point", "float", "float32", - "f64", "ieee754" ] } From 322405cefec05d3ad75781393076e13bedf640ba Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 2 Apr 2025 13:56:42 -0700 Subject: [PATCH 4/4] Apply suggestions from code review Signed-off-by: Athan --- .../@stdlib/constants/float32/max-safe-lucas/README.md | 5 ++--- .../constants/float32/max-safe-lucas/examples/index.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md index d74eee57ddcd..5b442ac16e5d 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/README.md @@ -52,9 +52,6 @@ var bool = ( FLOAT32_MAX_SAFE_LUCAS === 12752043 ); ```javascript var FLOAT32_MAX_SAFE_LUCAS = require( '@stdlib/constants/float32/max-safe-lucas' ); -var v; -var i; - function lucas( n ) { var a; var b; @@ -74,6 +71,8 @@ function lucas( n ) { return b; } +var v; +var i; for ( i = 0; i < 100; i++ ) { v = lucas( i ); if ( v > FLOAT32_MAX_SAFE_LUCAS ) { diff --git a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/examples/index.js b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/examples/index.js index 76f58c2b49d8..8baa8f257be0 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/examples/index.js +++ b/lib/node_modules/@stdlib/constants/float32/max-safe-lucas/examples/index.js @@ -20,9 +20,6 @@ var FLOAT32_MAX_SAFE_LUCAS = require( './../lib' ); -var v; -var i; - function lucas( n ) { var a; var b; @@ -42,6 +39,8 @@ function lucas( n ) { return b; } +var v; +var i; for ( i = 0; i < 100; i++ ) { v = lucas( i ); if ( v > FLOAT32_MAX_SAFE_LUCAS ) {