From 0e76f72801514966df328abb18bfe9526f1d17a4 Mon Sep 17 00:00:00 2001 From: sagar7162 Date: Thu, 11 Dec 2025 19:48:55 +0530 Subject: [PATCH 1/6] feat: add `constants/float16/sqrt-two` --- 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 --- --- .../constants/float16/sqrt-two/README.md | 96 +++++++++++++++++++ .../constants/float16/sqrt-two/docs/repl.txt | 12 +++ .../float16/sqrt-two/docs/types/index.d.ts | 33 +++++++ .../float16/sqrt-two/docs/types/test.ts | 28 ++++++ .../float16/sqrt-two/examples/index.js | 24 +++++ .../constants/float16/sqrt-two/lib/index.js | 48 ++++++++++ .../constants/float16/sqrt-two/package.json | 69 +++++++++++++ .../constants/float16/sqrt-two/test/test.js | 39 ++++++++ 8 files changed, 349 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md create mode 100644 lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/constants/float16/sqrt-two/examples/index.js create mode 100644 lib/node_modules/@stdlib/constants/float16/sqrt-two/lib/index.js create mode 100644 lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json create mode 100644 lib/node_modules/@stdlib/constants/float16/sqrt-two/test/test.js diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md b/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md new file mode 100644 index 000000000000..33fb5a058a43 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md @@ -0,0 +1,96 @@ + + +# FLOAT16_SQRT2 + +> [Square root][@stdlib/math/base/special/sqrtf] of `2` as a half-precision floating-point number. + +
+ +## Usage + +```javascript +var FLOAT16_SQRT2 = require( '@stdlib/constants/float16/sqrt-two' ); +``` + +#### FLOAT16_SQRT2 + +[Square root][@stdlib/math/base/special/sqrtf] of `2` as a half-precision floating-point number. + +```javascript +var bool = ( FLOAT16_SQRT2 === 1.4140625 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + + + +```javascript +var FLOAT16_SQRT2 = require( '@stdlib/constants/float16/sqrt-two' ); + +console.log( FLOAT16_SQRT2 ); +// => 1.4140625 +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/repl.txt b/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/repl.txt new file mode 100644 index 000000000000..19979ce9fcb6 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/repl.txt @@ -0,0 +1,12 @@ + +{{alias}} + Square root of `2` as a half-precision floating-point number. + + Examples + -------- + > {{alias}} + 1.4140625 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/types/index.d.ts new file mode 100644 index 000000000000..4eb246a34e98 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/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 + +/** +* Square root of `2`. +* +* @example +* var val = FLOAT16_SQRT2; +* // returns 1.4140625 +*/ +declare const FLOAT16_SQRT2: number; + + +// EXPORTS // + +export = FLOAT16_SQRT2; diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/types/test.ts b/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/types/test.ts new file mode 100644 index 000000000000..e2b253110ccb --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/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_SQRT2 = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT16_SQRT2; // $ExpectType number +} diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/examples/index.js b/lib/node_modules/@stdlib/constants/float16/sqrt-two/examples/index.js new file mode 100644 index 000000000000..4b6db4189fbf --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/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 FLOAT16_SQRT2 = require( './../lib' ); + +console.log( FLOAT16_SQRT2 ); +// => 1.4140625 diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/lib/index.js b/lib/node_modules/@stdlib/constants/float16/sqrt-two/lib/index.js new file mode 100644 index 000000000000..3bdde7605ab0 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/lib/index.js @@ -0,0 +1,48 @@ +/** +* @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'; + +/** +* Square root of `2`. +* +* @module @stdlib/constants/float16/sqrt-two +* @type {number} +* +* @example +* var FLOAT16_SQRT2 = require( '@stdlib/constants/float16/sqrt-two' ); +* // returns 1.4140625 +*/ + + +// MAIN // + +/** +* Square root of `2`. +* +* @constant +* @type {number} +* @default 1.4140625 +* @see [Wikipedia]{@link https://en.wikipedia.org/wiki/Square_root_of_2} +*/ +var FLOAT16_SQRT2 = 1.4140625; + + +// EXPORTS // + +module.exports = FLOAT16_SQRT2; diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json b/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json new file mode 100644 index 000000000000..b818852d11e0 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/constants/float16/sqrt-two", + "version": "0.0.0", + "description": "Square root of `2` as a half-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", + "sqrt", + "square", + "root", + "two", + "sqrt2", + "math.sqrt2", + "ieee754", + "single", + "floating-point", + "float16" + ] +} diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/test/test.js b/lib/node_modules/@stdlib/constants/float16/sqrt-two/test/test.js new file mode 100644 index 000000000000..0439d9d73bb4 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/test/test.js @@ -0,0 +1,39 @@ +/** +* @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_SQRT2 = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a number', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof FLOAT16_SQRT2, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'the exported value is a half-precision floating-point number equal to the square root of 2', function test( t ) { + var expected = 1.4140625; + t.strictEqual( FLOAT16_SQRT2, expected, 'returns expected value' ); + t.end(); +}); From 13e2ae8c4deb0385e4f29b7ea8f713bc25f246e1 Mon Sep 17 00:00:00 2001 From: sagar7162 Date: Thu, 11 Dec 2025 20:00:44 +0530 Subject: [PATCH 2/6] fix: update package.json --- 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: na - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - 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: na - task: lint_license_headers status: passed --- --- lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json b/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json index b818852d11e0..6d972b28f523 100644 --- a/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json @@ -17,7 +17,6 @@ "directories": { "doc": "./docs", "example": "./examples", - "include": "./include", "lib": "./lib", "test": "./test" }, From bfcf8897618efe38b6d817b5de14a9eff5c0781e Mon Sep 17 00:00:00 2001 From: Sagar Ratna Chaudhary <161244282+sagar7162@users.noreply.github.com> Date: Thu, 11 Dec 2025 20:38:45 +0530 Subject: [PATCH 3/6] fix: Update package.json Signed-off-by: Sagar Ratna Chaudhary <161244282+sagar7162@users.noreply.github.com> --- .../@stdlib/constants/float16/sqrt-two/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json b/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json index 6d972b28f523..f8ac2f6a1010 100644 --- a/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/package.json @@ -61,7 +61,7 @@ "sqrt2", "math.sqrt2", "ieee754", - "single", + "half", "floating-point", "float16" ] From 997cfd19724c074814c9bc57e13f9e3e2ad00c87 Mon Sep 17 00:00:00 2001 From: Sagar Ratna Chaudhary <161244282+sagar7162@users.noreply.github.com> Date: Thu, 11 Dec 2025 20:53:47 +0530 Subject: [PATCH 4/6] fix: Apply suggestions from code review Co-authored-by: Neeraj Pathak Signed-off-by: Sagar Ratna Chaudhary <161244282+sagar7162@users.noreply.github.com> --- .../@stdlib/constants/float16/sqrt-two/README.md | 7 ------- .../constants/float16/sqrt-two/docs/types/index.d.ts | 2 +- .../@stdlib/constants/float16/sqrt-two/lib/index.js | 4 ++-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md b/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md index 33fb5a058a43..7ab4d9f134b2 100644 --- a/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md @@ -66,13 +66,6 @@ console.log( FLOAT16_SQRT2 ); diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/types/index.d.ts index 4eb246a34e98..887064131cab 100644 --- a/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/docs/types/index.d.ts @@ -19,7 +19,7 @@ // TypeScript Version: 4.1 /** -* Square root of `2`. +* Square root of `2` as a half-precision floating-point number. * * @example * var val = FLOAT16_SQRT2; diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/lib/index.js b/lib/node_modules/@stdlib/constants/float16/sqrt-two/lib/index.js index 3bdde7605ab0..0f301a697053 100644 --- a/lib/node_modules/@stdlib/constants/float16/sqrt-two/lib/index.js +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* Square root of `2`. +* Square root of `2` as a half-precision floating-point number. * * @module @stdlib/constants/float16/sqrt-two * @type {number} @@ -33,7 +33,7 @@ // MAIN // /** -* Square root of `2`. +* Square root of `2` as a half-precision floating-point number. * * @constant * @type {number} From d3edd95dfdc33352546681223a160b8883f0f6e1 Mon Sep 17 00:00:00 2001 From: Sagar Ratna Chaudhary <161244282+sagar7162@users.noreply.github.com> Date: Thu, 11 Dec 2025 20:58:03 +0530 Subject: [PATCH 5/6] fix: Update README to remove related links Removed links to float32 and float64 sqrt-two constants. Signed-off-by: Sagar Ratna Chaudhary <161244282+sagar7162@users.noreply.github.com> --- lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md b/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md index 7ab4d9f134b2..8a2395768384 100644 --- a/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md @@ -78,10 +78,6 @@ console.log( FLOAT16_SQRT2 ); -[@stdlib/constants/float32/sqrt-two]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/float32/sqrt-two - -[@stdlib/constants/float64/sqrt-two]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/float64/sqrt-two - From 55e18762127b624b59c698ce1dd58b5a49c76c7b Mon Sep 17 00:00:00 2001 From: Sagar Ratna Chaudhary <161244282+sagar7162@users.noreply.github.com> Date: Thu, 11 Dec 2025 21:32:14 +0530 Subject: [PATCH 6/6] fix: Clean up README by removing commented links section Removed commented-out related links section from README. Signed-off-by: Sagar Ratna Chaudhary <161244282+sagar7162@users.noreply.github.com> --- lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md b/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md index 8a2395768384..c874c08d7a2f 100644 --- a/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md +++ b/lib/node_modules/@stdlib/constants/float16/sqrt-two/README.md @@ -76,10 +76,6 @@ console.log( FLOAT16_SQRT2 ); [@stdlib/math/base/special/sqrtf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/sqrtf - - - -