From 4405e782f56e5cfd29e4619787bc9029917fe38f Mon Sep 17 00:00:00 2001 From: hrshya Date: Fri, 21 Mar 2025 20:05:40 +0530 Subject: [PATCH 1/4] feat: add constants/float32/num-high-word-significand-bits --- .../num-high-word-significand-bits/README.md | 143 ++++++++++++++++++ .../docs/repl.txt | 12 ++ .../docs/types/index.d.ts | 33 ++++ .../docs/types/test.ts | 28 ++++ .../examples/index.js | 24 +++ .../float32/num_high_word_significand_bits.h | 27 ++++ .../lib/index.js | 47 ++++++ .../manifest.json | 36 +++++ .../package.json | 68 +++++++++ .../test/test.js | 38 +++++ 10 files changed, 456 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/README.md create mode 100644 lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/examples/index.js create mode 100644 lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/include/stdlib/constants/float32/num_high_word_significand_bits.h create mode 100644 lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/lib/index.js create mode 100644 lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/manifest.json create mode 100644 lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/package.json create mode 100644 lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/test/test.js diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/README.md b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/README.md new file mode 100644 index 000000000000..7d76a00d6de0 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/README.md @@ -0,0 +1,143 @@ + + +# FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS + +> Number of significand bits in the high word of a [single-precision floating-point number][ieee754]. + +
+ +## Usage + + + +```javascript +var FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/float32/num-high-word-significand-bits' ); +``` + +#### FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS + +Number of significand bits in the high word of a [single-precision floating-point number][ieee754]. + + + +```javascript +var bool = ( FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS === 23 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + + + +```javascript +var FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/float32/num-high-word-significand-bits' ); + +console.log( FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS ); +// => 23 +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float32/num_high_word_significand_bits.h" +``` + +#### STDLIB_CONSTANT_FLOAT64_NUM_HIGH_WORD_SIGNIFICAND_BITS + +Number of significand bits in the high word of a [single-precision floating-point number][ieee754]. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/repl.txt b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/repl.txt new file mode 100644 index 000000000000..7f51d7701671 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/repl.txt @@ -0,0 +1,12 @@ + +{{alias}} + Number of significand bits in the high word of a single-precision floating- + point number. + + Examples + -------- + > {{alias}} + 23 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/index.d.ts new file mode 100644 index 000000000000..3848d2632437 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/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 + +/** +* Number of significand bits in the high word of a single-precision floating-point number. +* +* @example +* var bits = FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS; +* // returns 23 +*/ +declare const FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS: number; + + +// EXPORTS // + +export = FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/test.ts new file mode 100644 index 000000000000..6b11bf73cdbc --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/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_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/float32/num-high-word-significand-bits/docs/types' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS; // $ExpectType number +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/examples/index.js b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/examples/index.js new file mode 100644 index 000000000000..11b8474a1904 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/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_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/float32/num-high-word-significand-bits/lib' ); // eslint-disable-line id-length + +console.log( FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS ); +// => 23 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/include/stdlib/constants/float32/num_high_word_significand_bits.h b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/include/stdlib/constants/float32/num_high_word_significand_bits.h new file mode 100644 index 000000000000..e72fe88751ba --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/include/stdlib/constants/float32/num_high_word_significand_bits.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_NUM_HIGH_WORD_SIGNIFICAND_BITS_H +#define STDLIB_CONSTANTS_FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS_H + +/** +* Number of significand bits in the high word of a single-precision floating-point number. +*/ +#define STDLIB_CONSTANT_FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS 23 + +#endif // !STDLIB_CONSTANTS_FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS_H \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/lib/index.js b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/lib/index.js new file mode 100644 index 000000000000..1476d2704dd6 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/lib/index.js @@ -0,0 +1,47 @@ +/** +* @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'; + +/** +* Number of significand bits in the high word of a single-precision floating-point number. +* +* @module @stdlib/constants/float32/num-high-word-significand-bits +* @type {integer32} +* +* @example +* var FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/float32/num-high-word-significand-bits' ); +* // returns 23 +*/ + + +// MAIN // + +/** +* Number of significand bits in the high word of a single-precision floating-point number. +* +* @constant +* @type {integer32} +* @default 23 +*/ +var FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS = 23|0; // eslint-disable-line id-length + + +// EXPORTS // + +module.exports = FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/manifest.json b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/manifest.json new file mode 100644 index 000000000000..eb75c0ae6ac6 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/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": [] + } + ] +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/package.json b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/package.json new file mode 100644 index 000000000000..3991ebf7f4e8 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/constants/float32/num-high-word-significand-bits", + "version": "0.0.0", + "description": "Number of significand bits in the high word of a 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", + "float", + "float32", + "64bit", + "floating-point", + "ieee754", + "significand", + "bits", + "high", + "word" + ] +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/test/test.js b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/test/test.js new file mode 100644 index 000000000000..068fdde061a3 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/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_NUM_HIGH_WORD_SIGNIFICAND_BITS = 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_NUM_HIGH_WORD_SIGNIFICAND_BITS, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'the exported value is 23', function test( t ) { + t.equal( FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS, 23, 'returns expected value' ); + t.end(); +}); \ No newline at end of file From daa7a13f83f21c563da1e6a41787c5516309be6e Mon Sep 17 00:00:00 2001 From: Harsh <149176984+hrshya@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:13:26 +0530 Subject: [PATCH 2/4] Update README.md Signed-off-by: Harsh <149176984+hrshya@users.noreply.github.com> --- .../float32/num-high-word-significand-bits/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/README.md b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/README.md index 7d76a00d6de0..8156237409fd 100644 --- a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/README.md +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2325 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. @@ -140,4 +140,4 @@ Number of significand bits in the high word of a [single-precision floating-poin - \ No newline at end of file + From 5c59f48c64e41753cd31471835473261609a795c Mon Sep 17 00:00:00 2001 From: hrshya Date: Fri, 21 Mar 2025 20:21:21 +0530 Subject: [PATCH 3/4] fix: resolves lint issues --- .../num-high-word-significand-bits/docs/types/index.d.ts | 2 +- .../float32/num-high-word-significand-bits/docs/types/test.ts | 2 +- .../float32/num-high-word-significand-bits/examples/index.js | 2 +- .../stdlib/constants/float32/num_high_word_significand_bits.h | 2 +- .../float32/num-high-word-significand-bits/lib/index.js | 2 +- .../float32/num-high-word-significand-bits/manifest.json | 2 +- .../float32/num-high-word-significand-bits/package.json | 2 +- .../float32/num-high-word-significand-bits/test/test.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/index.d.ts index 3848d2632437..250992cd022d 100644 --- a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/index.d.ts @@ -30,4 +30,4 @@ declare const FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS: number; // EXPORTS // -export = FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS; \ No newline at end of file +export = FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS; diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/test.ts index 6b11bf73cdbc..85151e50e8ff 100644 --- a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/test.ts +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/docs/types/test.ts @@ -25,4 +25,4 @@ import FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/floa { // eslint-disable-next-line @typescript-eslint/no-unused-expressions FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS; // $ExpectType number -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/examples/index.js b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/examples/index.js index 11b8474a1904..55c88a0afdf4 100644 --- a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/examples/index.js +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/examples/index.js @@ -21,4 +21,4 @@ var FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS = require( '@stdlib/constants/float32/num-high-word-significand-bits/lib' ); // eslint-disable-line id-length console.log( FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS ); -// => 23 \ No newline at end of file +// => 23 diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/include/stdlib/constants/float32/num_high_word_significand_bits.h b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/include/stdlib/constants/float32/num_high_word_significand_bits.h index e72fe88751ba..86388595c611 100644 --- a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/include/stdlib/constants/float32/num_high_word_significand_bits.h +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/include/stdlib/constants/float32/num_high_word_significand_bits.h @@ -24,4 +24,4 @@ */ #define STDLIB_CONSTANT_FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS 23 -#endif // !STDLIB_CONSTANTS_FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS_H \ No newline at end of file +#endif // !STDLIB_CONSTANTS_FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS_H diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/lib/index.js b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/lib/index.js index 1476d2704dd6..3eb5eaba9aac 100644 --- a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/lib/index.js +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/lib/index.js @@ -44,4 +44,4 @@ var FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS = 23|0; // eslint-disable-line id-len // EXPORTS // -module.exports = FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS; \ No newline at end of file +module.exports = FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS; diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/manifest.json b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/manifest.json index eb75c0ae6ac6..844d692f6439 100644 --- a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/manifest.json +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/manifest.json @@ -33,4 +33,4 @@ "dependencies": [] } ] -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/package.json b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/package.json index 3991ebf7f4e8..3b1ea1b62130 100644 --- a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/package.json +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/package.json @@ -65,4 +65,4 @@ "high", "word" ] -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/test/test.js b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/test/test.js index 068fdde061a3..f1e8334cf952 100644 --- a/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/test/test.js +++ b/lib/node_modules/@stdlib/constants/float32/num-high-word-significand-bits/test/test.js @@ -35,4 +35,4 @@ tape( 'main export is a number', function test( t ) { tape( 'the exported value is 23', function test( t ) { t.equal( FLOAT32_NUM_HIGH_WORD_SIGNIFICAND_BITS, 23, 'returns expected value' ); t.end(); -}); \ No newline at end of file +}); From a584b147b785a4ee0fe3a3af26916730cec7e695 Mon Sep 17 00:00:00 2001 From: hrshya Date: Sat, 22 Mar 2025 13:19:23 +0530 Subject: [PATCH 4/4] feat: add constants/float32/significand-bits --- .../float32/significand-bits/README.md | 143 ++++++++++++++++++ .../float32/significand-bits/docs/repl.txt | 12 ++ .../significand-bits/docs/types/index.d.ts | 33 ++++ .../significand-bits/docs/types/test.ts | 28 ++++ .../significand-bits/examples/index.js | 24 +++ .../constants/float32/significand_bits.h | 27 ++++ .../float32/significand-bits/lib/index.js | 47 ++++++ .../float32/significand-bits/manifest.json | 36 +++++ .../float32/significand-bits/package.json | 68 +++++++++ .../float32/significand-bits/test/test.js | 38 +++++ 10 files changed, 456 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/float32/significand-bits/README.md create mode 100644 lib/node_modules/@stdlib/constants/float32/significand-bits/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/constants/float32/significand-bits/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/constants/float32/significand-bits/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/constants/float32/significand-bits/examples/index.js create mode 100644 lib/node_modules/@stdlib/constants/float32/significand-bits/include/stdlib/constants/float32/significand_bits.h create mode 100644 lib/node_modules/@stdlib/constants/float32/significand-bits/lib/index.js create mode 100644 lib/node_modules/@stdlib/constants/float32/significand-bits/manifest.json create mode 100644 lib/node_modules/@stdlib/constants/float32/significand-bits/package.json create mode 100644 lib/node_modules/@stdlib/constants/float32/significand-bits/test/test.js diff --git a/lib/node_modules/@stdlib/constants/float32/significand-bits/README.md b/lib/node_modules/@stdlib/constants/float32/significand-bits/README.md new file mode 100644 index 000000000000..5978d3ec52a7 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/significand-bits/README.md @@ -0,0 +1,143 @@ + + +# FLOAT32_SIGNIFICAND_BITS + +> Number of significand bits of a [single-precision floating-point number][ieee754]. + +
+ +## Usage + + + +```javascript +var FLOAT32_SIGNIFICAND_BITS = require( '@stdlib/constants/float32/significand-bits' ); +``` + +#### FLOAT32_SIGNIFICAND_BITS + +Number of significand bits of a [single-precision floating-point number][ieee754]. + + + +```javascript +var bool = ( FLOAT32_SIGNIFICAND_BITS === 23 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + + + +```javascript +var FLOAT32_SIGNIFICAND_BITS = require( '@stdlib/constants/float32/significand-bits' ); + +console.log( FLOAT32_SIGNIFICAND_BITS ); +// => 23 +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float32/significand_bits.h" +``` + +#### STDLIB_CONSTANT_FLOAT32_SIGNIFICAND_BITS + +Number of significand bits of a [single-precision floating-point number][ieee754]. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/constants/float32/significand-bits/docs/repl.txt b/lib/node_modules/@stdlib/constants/float32/significand-bits/docs/repl.txt new file mode 100644 index 000000000000..d9d2a7117227 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/significand-bits/docs/repl.txt @@ -0,0 +1,12 @@ + +{{alias}} + Number of significand bits of a single-precision floating- + point number. + + Examples + -------- + > {{alias}} + 23 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/constants/float32/significand-bits/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float32/significand-bits/docs/types/index.d.ts new file mode 100644 index 000000000000..58216edb3525 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/significand-bits/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 + +/** +* Number of significand bits of a single-precision floating-point number. +* +* @example +* var bits = FLOAT32_SIGNIFICAND_BITS; +* // returns 23 +*/ +declare const FLOAT32_SIGNIFICAND_BITS: number; + + +// EXPORTS // + +export = FLOAT32_SIGNIFICAND_BITS; diff --git a/lib/node_modules/@stdlib/constants/float32/significand-bits/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float32/significand-bits/docs/types/test.ts new file mode 100644 index 000000000000..98d6cea43683 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/significand-bits/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_SIGNIFICAND_BITS = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT32_SIGNIFICAND_BITS; // $ExpectType number +} diff --git a/lib/node_modules/@stdlib/constants/float32/significand-bits/examples/index.js b/lib/node_modules/@stdlib/constants/float32/significand-bits/examples/index.js new file mode 100644 index 000000000000..e40d99d5596f --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/significand-bits/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_SIGNIFICAND_BITS = require( './../lib' ); // eslint-disable-line id-length + +console.log( FLOAT32_SIGNIFICAND_BITS ); +// => 23 diff --git a/lib/node_modules/@stdlib/constants/float32/significand-bits/include/stdlib/constants/float32/significand_bits.h b/lib/node_modules/@stdlib/constants/float32/significand-bits/include/stdlib/constants/float32/significand_bits.h new file mode 100644 index 000000000000..0818cbaa203d --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/significand-bits/include/stdlib/constants/float32/significand_bits.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_SIGNIFICAND_BITS_H +#define STDLIB_CONSTANTS_FLOAT32_SIGNIFICAND_BITS_H + +/** +* Number of significand bits of a single-precision floating-point number. +*/ +#define STDLIB_CONSTANT_FLOAT32_SIGNIFICAND_BITS 23 + +#endif // !STDLIB_CONSTANTS_FLOAT32_SIGNIFICAND_BITS_H diff --git a/lib/node_modules/@stdlib/constants/float32/significand-bits/lib/index.js b/lib/node_modules/@stdlib/constants/float32/significand-bits/lib/index.js new file mode 100644 index 000000000000..c37edfc3d2a4 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/significand-bits/lib/index.js @@ -0,0 +1,47 @@ +/** +* @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'; + +/** +* Number of significand bits of a single-precision floating-point number. +* +* @module @stdlib/constants/float32/significand-bits +* @type {integer32} +* +* @example +* var FLOAT32_SIGNIFICAND_BITS = require( '@stdlib/constants/float32/significand-bits' ); +* // returns 23 +*/ + + +// MAIN // + +/** +* Number of significand bits of a single-precision floating-point number. +* +* @constant +* @type {integer32} +* @default 23 +*/ +var FLOAT32_SIGNIFICAND_BITS = 23|0; // eslint-disable-line id-length + + +// EXPORTS // + +module.exports = FLOAT32_SIGNIFICAND_BITS; diff --git a/lib/node_modules/@stdlib/constants/float32/significand-bits/manifest.json b/lib/node_modules/@stdlib/constants/float32/significand-bits/manifest.json new file mode 100644 index 000000000000..844d692f6439 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/significand-bits/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/significand-bits/package.json b/lib/node_modules/@stdlib/constants/float32/significand-bits/package.json new file mode 100644 index 000000000000..ef0c73f08df9 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/significand-bits/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/constants/float32/significand-bits", + "version": "0.0.0", + "description": "Number of significand bits of a 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", + "float", + "float32", + "64bit", + "floating-point", + "ieee754", + "significand", + "bits", + "high", + "word" + ] +} diff --git a/lib/node_modules/@stdlib/constants/float32/significand-bits/test/test.js b/lib/node_modules/@stdlib/constants/float32/significand-bits/test/test.js new file mode 100644 index 000000000000..e71f120e8091 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float32/significand-bits/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_SIGNIFICAND_BITS = 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_SIGNIFICAND_BITS, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'the exported value is 23', function test( t ) { + t.equal( FLOAT32_SIGNIFICAND_BITS, 23, 'returns expected value' ); + t.end(); +});