From a53b99a735c4f7baec86e98273b25cdf795848ce Mon Sep 17 00:00:00 2001 From: hrshya Date: Fri, 21 Mar 2025 14:21:50 +0530 Subject: [PATCH 01/13] feat: add constants/float32/max-ln --- .../constants/float32/max-ln/README.md | 149 ++++++++++++++++++ .../constants/float32/max-ln/docs/repl.txt | 11 ++ .../float32/max-ln/docs/types/index.d.ts | 33 ++++ .../float32/max-ln/docs/types/test.ts | 28 ++++ .../float32/max-ln/examples/index.js | 24 +++ .../include/stdlib/constants/float32/max_ln.h | 27 ++++ .../constants/float32/max-ln/lib/index.js | 60 +++++++ .../constants/float32/max-ln/mainfest.json | 36 +++++ .../constants/float32/max-ln/package.json | 75 +++++++++ .../constants/float32/max-ln/test/test.js | 44 ++++++ 10 files changed, 487 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/float32/max-ln/README.md create mode 100644 lib/node_modules/@stdlib/constants/float32/max-ln/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/constants/float32/max-ln/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/constants/float32/max-ln/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/constants/float32/max-ln/examples/index.js create mode 100644 lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h create mode 100644 lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js create mode 100644 lib/node_modules/@stdlib/constants/float32/max-ln/mainfest.json create mode 100644 lib/node_modules/@stdlib/constants/float32/max-ln/package.json create mode 100644 lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/README.md b/lib/node_modules/@stdlib/constants/float32/max-ln/README.md new file mode 100644 index 000000000000..957d81aeb465 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/README.md @@ -0,0 +1,149 @@ + + +# FLOAT32_MAX_LN + +> [Natural logarithm][natural-logarithm] of the maximum [single-precision floating-point number][ieee754]. + +
+ +## Usage + +```javascript +var FLOAT32_MAX_LN = require( '@stdlib/constants/float32/max-ln' ); +``` + +#### FLOAT32_MAX_LN + +[Natural logarithm][natural-logarithm] of the maximum [single-precision floating-point number][ieee754]. + +```javascript +var bool = ( FLOAT32_MAX_LN === 88.722839 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + + + +```javascript +var FLOAT32_MAX_LN = require( '@stdlib/constants/float32/max-ln' ); + +console.log( FLOAT32_MAX_LN ); +// => 88.722839 +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float32/max_ln.h" +``` + +#### STDLIB_CONSTANT_FLOAT64_MAX_LN + +Macro for the [natural logarithm][natural-logarithm] of the maximum [single-precision floating-point number][ieee754]. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/docs/repl.txt b/lib/node_modules/@stdlib/constants/float32/max-ln/docs/repl.txt new file mode 100644 index 000000000000..9916cd3586e9 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/docs/repl.txt @@ -0,0 +1,11 @@ + +{{alias}} + Natural logarithm of the maximum single-precision floating-point number. + + Examples + -------- + > {{alias}} + 88.72283935546875 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float32/max-ln/docs/types/index.d.ts new file mode 100644 index 000000000000..a7ceda019f7f --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/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 + +/** +* Natural logarithm of the maximum single-precision floating-point number. +* +* @example +* var val = FLOAT32_MAX_LN; +* // returns 88.72283935546875 +*/ +declare const FLOAT32_MAX_LN: number; + + +// EXPORTS // + +export = FLOAT32_MAX_LN; diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float32/max-ln/docs/types/test.ts new file mode 100644 index 000000000000..39060b835b96 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/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_LN = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT32_MAX_LN; // $ExpectType number +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/examples/index.js b/lib/node_modules/@stdlib/constants/float32/max-ln/examples/index.js new file mode 100644 index 000000000000..340c06a756a7 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/examples/index.js @@ -0,0 +1,24 @@ +/** +* @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_LN = require( './../lib' ); + +console.log( FLOAT32_MAX_LN ); +// => 88.72283935546875 diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h b/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h new file mode 100644 index 000000000000..2ad75209c4a7 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.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_LN_H + #define STDLIB_CONSTANTS_FLOAT32_MAX_LN_H + + /** + * Macro for the natural logarithm of the maximum single-precision floating-point number. + */ + #define STDLIB_CONSTANT_FLOAT32_MAX_LN 88.72283935546875f + + #endif // !STDLIB_CONSTANTS_FLOAT32_MAX_LN_H diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js b/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js new file mode 100644 index 000000000000..f6a75392b123 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/lib/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'; + +/** +* Natural logarithm of the maximum single-precision floating-point number. +* +* @module @stdlib/constants/float32/max-ln +* @type {number} +* +* @example +* var FLOAT32_MAX_LN = require( '@stdlib/constants/float32/max-ln' ); +* // returns 88.722839 +*/ + +// MODULES // + +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); + + +// MAIN // + +/** +* Natural logarithm of the maximum single-precision floating-point number. +* +* ## Notes +* +* The natural logarithm of the maximum is given by +* +* ```tex +* \ln \left( 2^{1023} (2 - 2^{-52}) \right) +* ``` +* +* @constant +* @type {number} +* @default 88.72283935546875 +* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985} +*/ +var FLOAT32_MAX_LN = float64ToFloat32( 88.72283935546875 ); + + +// EXPORTS // + +module.exports = FLOAT32_MAX_LN; diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/mainfest.json b/lib/node_modules/@stdlib/constants/float32/max-ln/mainfest.json new file mode 100644 index 000000000000..eb75c0ae6ac6 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/mainfest.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": [] + } + ] +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/package.json b/lib/node_modules/@stdlib/constants/float32/max-ln/package.json new file mode 100644 index 000000000000..6ad81b5fa6e4 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/package.json @@ -0,0 +1,75 @@ +{ + "name": "@stdlib/constants/float32/max-ln", + "version": "0.0.0", + "description": "Natural logarithm of the maximum single-precision floating-point number.", + "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", + "mathematics", + "math", + "max", + "maximum", + "floating-point", + "float32", + "float", + "64bit", + "ieee754", + "double", + "dbl", + "precision", + "largest", + "greatest", + "natural", + "logarithm", + "log", + "ln" + ] +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js b/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js new file mode 100644 index 000000000000..b4df77932c6e --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js @@ -0,0 +1,44 @@ +/** +* @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 pow = require( '@stdlib/math/base/special/pow' ); +var lnf = require( '@stdlib/math/base/special/lnf' ); +var FLOAT32_MAX = require( '@stdlib/constants/float32/max' ); +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var FLOAT32_MAX_LN = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a number', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof FLOAT32_MAX_LN, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'export is a single-precision floating-point number equal to the natural logarithm of the max single-precision floating-point number', function test( t ) { + t.equal( FLOAT32_MAX_LN, float64ToFloat32( lnf( float64ToFloat32( pow( 2, 127 ) ) * ( 2 - float64ToFloat32( pow( 2, -23 ) ) ) ) ), 'equals the logarithm of the max value (computed)' ); + t.equal( FLOAT32_MAX_LN, lnf( FLOAT32_MAX ), 'equals the logarithm of the max value' ); + t.end(); +}); From 60159af0fc982399f4d02b471f2720120e95ecb1 Mon Sep 17 00:00:00 2001 From: hrshya Date: Fri, 21 Mar 2025 16:36:40 +0530 Subject: [PATCH 02/13] fix: resolve lint errors --- lib/node_modules/@stdlib/constants/float32/max-ln/README.md | 6 +++--- .../@stdlib/constants/float32/max-ln/lib/index.js | 2 +- .../@stdlib/constants/float32/max-ln/test/test.js | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/README.md b/lib/node_modules/@stdlib/constants/float32/max-ln/README.md index 957d81aeb465..c3a322c79628 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/README.md @@ -35,7 +35,7 @@ var FLOAT32_MAX_LN = require( '@stdlib/constants/float32/max-ln' ); [Natural logarithm][natural-logarithm] of the maximum [single-precision floating-point number][ieee754]. ```javascript -var bool = ( FLOAT32_MAX_LN === 88.722839 ); +var bool = ( FLOAT32_MAX_LN === 88.72283935546875 ); // returns true ``` @@ -55,7 +55,7 @@ var bool = ( FLOAT32_MAX_LN === 88.722839 ); var FLOAT32_MAX_LN = require( '@stdlib/constants/float32/max-ln' ); console.log( FLOAT32_MAX_LN ); -// => 88.722839 +// => 88.72283935546875 ``` @@ -146,4 +146,4 @@ Macro for the [natural logarithm][natural-logarithm] of the maximum [single-prec - \ No newline at end of file + diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js b/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js index f6a75392b123..422ae94610e5 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js @@ -26,7 +26,7 @@ * * @example * var FLOAT32_MAX_LN = require( '@stdlib/constants/float32/max-ln' ); -* // returns 88.722839 +* // returns 88.72283935546875 */ // MODULES // diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js b/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js index b4df77932c6e..63c02d0747b8 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js @@ -1,8 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 - The Stdlib Authors. +* 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. From 90ee9a80daa6a60c374a1d772318f0cc543fe363 Mon Sep 17 00:00:00 2001 From: Harsh <149176984+hrshya@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:45:32 +0530 Subject: [PATCH 03/13] Update max_ln.h Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com> --- .../include/stdlib/constants/float32/max_ln.h | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h b/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h index 2ad75209c4a7..5cbaf8de33bd 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h @@ -1,20 +1,20 @@ /** - * @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. - */ +* @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_LN_H #define STDLIB_CONSTANTS_FLOAT32_MAX_LN_H From d9717634ab928039379f09b7ab59a7ce40ca5c1a Mon Sep 17 00:00:00 2001 From: Harsh <149176984+hrshya@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:56:07 +0530 Subject: [PATCH 04/13] Update max_ln.h Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com> --- .../include/stdlib/constants/float32/max_ln.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h b/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h index 5cbaf8de33bd..ddd5ab7e67de 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/include/stdlib/constants/float32/max_ln.h @@ -16,12 +16,12 @@ * limitations under the License. */ - #ifndef STDLIB_CONSTANTS_FLOAT32_MAX_LN_H - #define STDLIB_CONSTANTS_FLOAT32_MAX_LN_H +#ifndef STDLIB_CONSTANTS_FLOAT32_MAX_LN_H +#define STDLIB_CONSTANTS_FLOAT32_MAX_LN_H - /** - * Macro for the natural logarithm of the maximum single-precision floating-point number. - */ - #define STDLIB_CONSTANT_FLOAT32_MAX_LN 88.72283935546875f +/** +* Macro for the natural logarithm of the maximum single-precision floating-point number. +*/ +#define STDLIB_CONSTANT_FLOAT32_MAX_LN 88.72283935546875f - #endif // !STDLIB_CONSTANTS_FLOAT32_MAX_LN_H +#endif // !STDLIB_CONSTANTS_FLOAT32_MAX_LN_H From da45923b29d99b4961ab07cdadc59b6d85683776 Mon Sep 17 00:00:00 2001 From: Harsh <149176984+hrshya@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:56:44 +0530 Subject: [PATCH 05/13] Update mainfest.json Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com> --- lib/node_modules/@stdlib/constants/float32/max-ln/mainfest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/mainfest.json b/lib/node_modules/@stdlib/constants/float32/max-ln/mainfest.json index eb75c0ae6ac6..844d692f6439 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/mainfest.json +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/mainfest.json @@ -33,4 +33,4 @@ "dependencies": [] } ] -} \ No newline at end of file +} From 6afa9ebc4987a7678b5f3bc0f7aa3d66d0455aaf Mon Sep 17 00:00:00 2001 From: Harsh <149176984+hrshya@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:57:28 +0530 Subject: [PATCH 06/13] Update package.json Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com> --- lib/node_modules/@stdlib/constants/float32/max-ln/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/package.json b/lib/node_modules/@stdlib/constants/float32/max-ln/package.json index 6ad81b5fa6e4..91918dcda1a9 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/package.json +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/package.json @@ -72,4 +72,4 @@ "log", "ln" ] -} \ No newline at end of file +} From 03b0a4cab74d2f64205fe3be70243aec7161ade1 Mon Sep 17 00:00:00 2001 From: Harsh <149176984+hrshya@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:58:18 +0530 Subject: [PATCH 07/13] Update test.ts Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com> --- .../@stdlib/constants/float32/max-ln/docs/types/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float32/max-ln/docs/types/test.ts index 39060b835b96..7a0b1605f82d 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/docs/types/test.ts +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/docs/types/test.ts @@ -25,4 +25,4 @@ import FLOAT32_MAX_LN = require( './index' ); { // eslint-disable-next-line @typescript-eslint/no-unused-expressions FLOAT32_MAX_LN; // $ExpectType number -} \ No newline at end of file +} From fc3b9c310891e4de82ca0d311e4d25a6b26faeda Mon Sep 17 00:00:00 2001 From: Harsh <149176984+hrshya@users.noreply.github.com> Date: Sun, 23 Mar 2025 19:41:05 +0530 Subject: [PATCH 08/13] update README.md Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com> --- .../@stdlib/constants/float32/max-ln/README.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/README.md b/lib/node_modules/@stdlib/constants/float32/max-ln/README.md index c3a322c79628..3b3ce992d042 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/README.md +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/README.md @@ -120,12 +120,6 @@ Macro for the [natural logarithm][natural-logarithm] of the maximum [single-prec @@ -138,12 +132,6 @@ Macro for the [natural logarithm][natural-logarithm] of the maximum [single-prec [natural-logarithm]: https://en.wikipedia.org/wiki/Natural_logarithm - - -[@stdlib/constants/float64/min-ln]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/float64/min-ln - - - From 9ea47ade21d997c52c227e16cbb422924d05ad6b Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 2 Apr 2025 00:05:42 -0700 Subject: [PATCH 09/13] refactor: remove unnecessary wrapping Signed-off-by: Athan --- .../@stdlib/constants/float32/max-ln/lib/index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js b/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js index 422ae94610e5..83fc348e25aa 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js @@ -29,11 +29,6 @@ * // returns 88.72283935546875 */ -// MODULES // - -var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); - - // MAIN // /** @@ -52,7 +47,7 @@ var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); * @default 88.72283935546875 * @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985} */ -var FLOAT32_MAX_LN = float64ToFloat32( 88.72283935546875 ); +var FLOAT32_MAX_LN = 88.72283935546875; // EXPORTS // From 14fe2e5e0be5dea0a2bbedf365cedf140173aa7d Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 2 Apr 2025 00:06:25 -0700 Subject: [PATCH 10/13] chore: update keywords Signed-off-by: Athan --- .../@stdlib/constants/float32/max-ln/package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/package.json b/lib/node_modules/@stdlib/constants/float32/max-ln/package.json index 91918dcda1a9..12d7726586f8 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/package.json +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/package.json @@ -60,10 +60,9 @@ "floating-point", "float32", "float", - "64bit", + "32bit", "ieee754", - "double", - "dbl", + "flt", "precision", "largest", "greatest", From c7d1693e0214dc0c9ebd418fdca93ff9407f4da8 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 2 Apr 2025 00:07:09 -0700 Subject: [PATCH 11/13] test: update assertion messages Signed-off-by: Athan --- .../@stdlib/constants/float32/max-ln/test/test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js b/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js index 63c02d0747b8..1908a60820b3 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js @@ -37,7 +37,7 @@ tape( 'main export is a number', function test( t ) { }); tape( 'export is a single-precision floating-point number equal to the natural logarithm of the max single-precision floating-point number', function test( t ) { - t.equal( FLOAT32_MAX_LN, float64ToFloat32( lnf( float64ToFloat32( pow( 2, 127 ) ) * ( 2 - float64ToFloat32( pow( 2, -23 ) ) ) ) ), 'equals the logarithm of the max value (computed)' ); - t.equal( FLOAT32_MAX_LN, lnf( FLOAT32_MAX ), 'equals the logarithm of the max value' ); + t.equal( FLOAT32_MAX_LN, float64ToFloat32( lnf( float64ToFloat32( pow( 2, 127 ) ) * ( 2 - float64ToFloat32( pow( 2, -23 ) ) ) ) ), 'returns expected value' ); + t.equal( FLOAT32_MAX_LN, lnf( FLOAT32_MAX ), 'returns expected value' ); t.end(); }); From 8cc39e285004de4676bd8f08cc9b1cd4f65524b2 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 2 Apr 2025 00:08:53 -0700 Subject: [PATCH 12/13] docs: fix equation Signed-off-by: Athan --- lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js b/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js index 83fc348e25aa..584baabe872c 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/lib/index.js @@ -39,7 +39,7 @@ * The natural logarithm of the maximum is given by * * ```tex -* \ln \left( 2^{1023} (2 - 2^{-52}) \right) +* \ln \left( 2^{127} (2 - 2^{-23}) \right) * ``` * * @constant From ef6e102d9e1f44cd2d6038aec4d20a3df25b29b1 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 2 Apr 2025 00:09:57 -0700 Subject: [PATCH 13/13] test: cast intermediate result to single-precision Signed-off-by: Athan --- lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js b/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js index 1908a60820b3..28dd1a614fb5 100644 --- a/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js +++ b/lib/node_modules/@stdlib/constants/float32/max-ln/test/test.js @@ -37,7 +37,7 @@ tape( 'main export is a number', function test( t ) { }); tape( 'export is a single-precision floating-point number equal to the natural logarithm of the max single-precision floating-point number', function test( t ) { - t.equal( FLOAT32_MAX_LN, float64ToFloat32( lnf( float64ToFloat32( pow( 2, 127 ) ) * ( 2 - float64ToFloat32( pow( 2, -23 ) ) ) ) ), 'returns expected value' ); + t.equal( FLOAT32_MAX_LN, float64ToFloat32( lnf( float64ToFloat32( pow( 2, 127 ) ) * float64ToFloat32( 2 - float64ToFloat32( pow( 2, -23 ) ) ) ) ), 'returns expected value' ); t.equal( FLOAT32_MAX_LN, lnf( FLOAT32_MAX ), 'returns expected value' ); t.end(); });