From 21290f0cbb4bbf062689b2f36d9f4518373e5559 Mon Sep 17 00:00:00 2001 From: iampratik13 Date: Mon, 18 May 2026 00:28:00 +0530 Subject: [PATCH 1/5] feat: add lapack/base/dlaisnan --- 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: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../@stdlib/lapack/base/dlaisnan/README.md | 182 ++++++++++++++++++ .../base/dlaisnan/benchmark/benchmark.js | 56 ++++++ .../lapack/base/dlaisnan/docs/repl.txt | 29 +++ .../base/dlaisnan/docs/types/index.d.ts | 41 ++++ .../lapack/base/dlaisnan/docs/types/test.ts | 56 ++++++ .../lapack/base/dlaisnan/examples/index.js | 31 +++ .../@stdlib/lapack/base/dlaisnan/lib/index.js | 43 +++++ .../@stdlib/lapack/base/dlaisnan/lib/main.js | 53 +++++ .../@stdlib/lapack/base/dlaisnan/package.json | 69 +++++++ .../@stdlib/lapack/base/dlaisnan/test/test.js | 112 +++++++++++ 10 files changed, 672 insertions(+) create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaisnan/examples/index.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaisnan/package.json create mode 100644 lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md b/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md new file mode 100644 index 000000000000..393748872f67 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md @@ -0,0 +1,182 @@ + + +# dlaisnan + +> LAPACK auxiliary routine to test input for NaN by comparing two double-precision floating-point arguments for inequality. + +
+ +## Usage + +```javascript +var dlaisnan = require( '@stdlib/lapack/base/dlaisnan' ); +``` + +#### dlaisnan( DIN1, DIN2 ) + +Tests whether two double-precision floating-point arguments are unequal and thus at least one is NaN. + +```javascript +var bool = dlaisnan( NaN, NaN ); +// returns true + +bool = dlaisnan( NaN, 5.0 ); +// returns true + +bool = dlaisnan( 5.0, 5.0 ); +// returns false +``` + +The function has the following parameters: + +- **DIN1**: first number to compare. +- **DIN2**: second number to compare. + +
+ + + +
+ +## Notes + +- `dlaisnan()` corresponds to the [LAPACK][LAPACK] auxiliary routine [`dlaisnan`][lapack-dlaisnan]. +- This routine is not for general use. It exists solely to avoid over-optimization in `disnan`. +- `dlaisnan` checks for NaNs by comparing its two arguments for inequality. `NaN` is the only floating-point value where `NaN != NaN` returns `true`. To check for NaNs, pass the same variable as both arguments (i.e., `dlaisnan( x, x )`). +- The function returns `true` whenever the two arguments are unequal, not only when one is NaN. This matches the Fortran reference implementation which simply returns `DIN1.NE.DIN2`. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var dlaisnan = require( '@stdlib/lapack/base/dlaisnan' ); + +var opts = { + 'dtype': 'float64' +}; +var x = discreteUniform( 100, -50, 50, opts ); +var y = discreteUniform( 100, -50, 50, opts ); + +logEachMap( 'dlaisnan( %d, %d ) = %s', x, y, dlaisnan ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js new file mode 100644 index 000000000000..139e57cbce9e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js @@ -0,0 +1,56 @@ +/** +* @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 bench = require( '@stdlib/bench' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var pkg = require( './../package.json' ).name; +var dlaisnan = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var len; + var x; + var y; + var z; + var i; + + len = 100; + x = uniform( len, -50, 50 ); + y = uniform( len, -50, 50 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dlaisnan( x[ i % len ], y[ i % len ] ); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/repl.txt new file mode 100644 index 000000000000..1439c27f77f5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/repl.txt @@ -0,0 +1,29 @@ + +{{alias}}( DIN1, DIN2 ) + Tests whether two double-precision floating-point arguments are unequal + and thus at least one is NaN. + + Parameters + ---------- + DIN1: number + First number to compare. + + DIN2: number + Second number to compare. + + Returns + ------- + bool: boolean + Boolean indicating whether the arguments are unequal. + + Examples + -------- + > var bool = {{alias}}( NaN, NaN ) + true + > bool = {{alias}}( NaN, 5.0 ) + true + > bool = {{alias}}( 5.0, 5.0 ) + false + + See Also + -------- diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts new file mode 100644 index 000000000000..37e6ce02c48b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts @@ -0,0 +1,41 @@ +/* +* @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 + +/** +* LAPACK auxiliary routine to test input for NaN by comparing two double-precision floating-point arguments for inequality. +* +* @param DIN1 - first number to compare +* @param DIN2 - second number to compare +* @returns boolean indicating whether the arguments are unequal +* +* @example +* var bool = dlaisnan( NaN, NaN ); +* // returns true +* +* @example +* var bool = dlaisnan( 5.0, 5.0 ); +* // returns false +*/ +declare function dlaisnan( DIN1: number, DIN2: number ): boolean; + + +// EXPORTS // + +export = dlaisnan; diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/test.ts new file mode 100644 index 000000000000..cd6aeeaf8a13 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/test.ts @@ -0,0 +1,56 @@ +/* +* @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 dlaisnan = require( './index' ); + + +// TESTS // + +// The function returns a boolean... +{ + dlaisnan( 8, 2 ); // $ExpectType boolean +} + +// The compiler throws an error if the function is provided values other than two numbers... +{ + dlaisnan( true, 3 ); // $ExpectError + dlaisnan( false, 2 ); // $ExpectError + dlaisnan( '5', 1 ); // $ExpectError + dlaisnan( [], 1 ); // $ExpectError + dlaisnan( {}, 2 ); // $ExpectError + dlaisnan( ( x: number ): number => x, 2 ); // $ExpectError + + dlaisnan( 9, true ); // $ExpectError + dlaisnan( 9, false ); // $ExpectError + dlaisnan( 5, '5' ); // $ExpectError + dlaisnan( 8, [] ); // $ExpectError + dlaisnan( 9, {} ); // $ExpectError + dlaisnan( 8, ( x: number ): number => x ); // $ExpectError + + dlaisnan( [], true ); // $ExpectError + dlaisnan( {}, false ); // $ExpectError + dlaisnan( false, '5' ); // $ExpectError + dlaisnan( {}, [] ); // $ExpectError + dlaisnan( '5', ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + dlaisnan(); // $ExpectError + dlaisnan( 3 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/examples/index.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/examples/index.js new file mode 100644 index 000000000000..c3a8f779cb97 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/examples/index.js @@ -0,0 +1,31 @@ +/** +* @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 discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var dlaisnan = require( './../lib' ); + +var opts = { + 'dtype': 'float64' +}; +var x = discreteUniform( 100, -50, 50, opts ); +var y = discreteUniform( 100, -50, 50, opts ); + +logEachMap( 'dlaisnan( %d, %d ) = %s', x, y, dlaisnan ); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js new file mode 100644 index 000000000000..b1c3e7475eb7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js @@ -0,0 +1,43 @@ +/** +* @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'; + +/** +* LAPACK auxiliary routine to test input for NaN by comparing two double-precision floating-point arguments for inequality. +* +* @module @stdlib/lapack/base/dlaisnan +* +* @example +* var dlaisnan = require( '@stdlib/lapack/base/dlaisnan' ); +* +* var bool = dlaisnan( NaN, NaN ); +* // returns true +* +* bool = dlaisnan( 5.0, 5.0 ); +* // returns false +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js new file mode 100644 index 000000000000..c769bf0e928b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js @@ -0,0 +1,53 @@ +/** +* @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'; + +// MAIN // + +/** +* Tests whether two double-precision floating-point arguments are unequal and thus at least one is NaN. +* +* ## Notes +* +* - This routine exists solely to avoid over-optimization in DISNAN. +* +* @param {number} DIN1 - first number to compare +* @param {number} DIN2 - second number to compare +* @returns {boolean} boolean indicating whether the arguments are unequal +* +* @example +* var bool = dlaisnan( NaN, NaN ); +* // returns true +* +* @example +* var bool = dlaisnan( NaN, 5.0 ); +* // returns true +* +* @example +* var bool = dlaisnan( 5.0, 5.0 ); +* // returns false +*/ +function dlaisnan( DIN1, DIN2 ) { + return ( DIN1 !== DIN2 ); +} + + +// EXPORTS // + +module.exports = dlaisnan; diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/package.json b/lib/node_modules/@stdlib/lapack/base/dlaisnan/package.json new file mode 100644 index 000000000000..a68cc4f91474 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/lapack/base/dlaisnan", + "version": "0.0.0", + "description": "LAPACK auxiliary routine to test input for NaN by comparing two double-precision floating-point arguments for inequality.", + "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": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "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", + "mathematics", + "math", + "lapack", + "dlaisnan", + "nan", + "isnan", + "test", + "inequality", + "linear", + "algebra", + "subroutines", + "float64", + "double", + "float64array" + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js new file mode 100644 index 000000000000..9bab475e82d0 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js @@ -0,0 +1,112 @@ +/** +* @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 PINF = require( '@stdlib/constants/float64/pinf' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var dlaisnan = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlaisnan, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 2', function test( t ) { + t.strictEqual( dlaisnan.length, 2, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `true` when either argument is NaN', function test( t ) { + var bool; + + bool = dlaisnan( NaN, NaN ); + t.strictEqual( bool, true, 'returns expected value' ); + + bool = dlaisnan( NaN, 5.0 ); + t.strictEqual( bool, true, 'returns expected value' ); + + bool = dlaisnan( 5.0, NaN ); + t.strictEqual( bool, true, 'returns expected value' ); + + bool = dlaisnan( NaN, 0.0 ); + t.strictEqual( bool, true, 'returns expected value' ); + + bool = dlaisnan( 0.0, NaN ); + t.strictEqual( bool, true, 'returns expected value' ); + + bool = dlaisnan( NaN, PINF ); + t.strictEqual( bool, true, 'returns expected value' ); + + bool = dlaisnan( NINF, NaN ); + t.strictEqual( bool, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `false` when both arguments are equal non-NaN values', function test( t ) { + var bool; + + bool = dlaisnan( 5.0, 5.0 ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = dlaisnan( 0.0, 0.0 ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = dlaisnan( -0.0, -0.0 ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = dlaisnan( -0.0, 0.0 ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = dlaisnan( PINF, PINF ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = dlaisnan( NINF, NINF ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = dlaisnan( -3.14, -3.14 ); + t.strictEqual( bool, false, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `true` when both arguments are unequal non-NaN values', function test( t ) { + var bool; + + bool = dlaisnan( 1.0, 2.0 ); + t.strictEqual( bool, true, 'returns expected value' ); + + bool = dlaisnan( -1.0, 1.0 ); + t.strictEqual( bool, true, 'returns expected value' ); + + bool = dlaisnan( PINF, NINF ); + t.strictEqual( bool, true, 'returns expected value' ); + + bool = dlaisnan( 0.0, 1.0 ); + t.strictEqual( bool, true, 'returns expected value' ); + + t.end(); +}); From 4f70f76a6dae6d266c79057d1fecca0402b6e84e Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Sun, 17 May 2026 19:09:37 +0000 Subject: [PATCH 2/5] chore: update copyright years --- lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md | 2 +- .../@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js | 2 +- .../@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts | 2 +- .../@stdlib/lapack/base/dlaisnan/docs/types/test.ts | 2 +- lib/node_modules/@stdlib/lapack/base/dlaisnan/examples/index.js | 2 +- lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js | 2 +- lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js | 2 +- lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md b/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md index 393748872f67..7cfc45537702 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2025 The Stdlib Authors. +Copyright (c) 2026 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js index 139e57cbce9e..bb1b9da587ef 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts index 37e6ce02c48b..6467c096498c 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/test.ts index cd6aeeaf8a13..8115794c5bfa 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/test.ts +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/test.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/examples/index.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/examples/index.js index c3a8f779cb97..92e8b0037ed0 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/examples/index.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js index b1c3e7475eb7..07197a771143 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js index c769bf0e928b..48fd6c7ccd20 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js index 9bab475e82d0..08c9d58bbf96 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 9e4bf55db67bc86212f3fb71d8606d67dd1cf3b5 Mon Sep 17 00:00:00 2001 From: iampratik13 Date: Tue, 19 May 2026 19:44:55 +0530 Subject: [PATCH 3/5] chore: suggested changes --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- .../@stdlib/lapack/base/dlaisnan/README.md | 16 ++++++----- .../base/dlaisnan/benchmark/benchmark.js | 10 +++---- .../lapack/base/dlaisnan/docs/repl.txt | 8 +++--- .../base/dlaisnan/docs/types/index.d.ts | 4 +-- .../@stdlib/lapack/base/dlaisnan/lib/main.js | 8 +++--- .../@stdlib/lapack/base/dlaisnan/test/test.js | 27 +++++++++++++++++++ 6 files changed, 51 insertions(+), 22 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md b/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md index 7cfc45537702..a32875fbc032 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/README.md @@ -32,7 +32,7 @@ var dlaisnan = require( '@stdlib/lapack/base/dlaisnan' ); #### dlaisnan( DIN1, DIN2 ) -Tests whether two double-precision floating-point arguments are unequal and thus at least one is NaN. +Tests input for NaN by comparing two double-precision floating-point arguments for inequality. ```javascript var bool = dlaisnan( NaN, NaN ); @@ -47,8 +47,8 @@ bool = dlaisnan( 5.0, 5.0 ); The function has the following parameters: -- **DIN1**: first number to compare. -- **DIN2**: second number to compare. +- **DIN1**: first input number. +- **DIN2**: second input number. @@ -58,10 +58,10 @@ The function has the following parameters: ## Notes -- `dlaisnan()` corresponds to the [LAPACK][LAPACK] auxiliary routine [`dlaisnan`][lapack-dlaisnan]. -- This routine is not for general use. It exists solely to avoid over-optimization in `disnan`. -- `dlaisnan` checks for NaNs by comparing its two arguments for inequality. `NaN` is the only floating-point value where `NaN != NaN` returns `true`. To check for NaNs, pass the same variable as both arguments (i.e., `dlaisnan( x, x )`). -- The function returns `true` whenever the two arguments are unequal, not only when one is NaN. This matches the Fortran reference implementation which simply returns `DIN1.NE.DIN2`. +- `dlaisnan()` corresponds to the [LAPACK][lapack] auxiliary routine [`dlaisnan`][lapack-dlaisnan]. +- This routine is not for general use. It exists solely to avoid over-optimization in [`disnan`][lapack-disnan]. +- `dlaisnan` checks for NaNs by comparing its two arguments for inequality. `NaN` is the only floating-point value where `NaN !== NaN` returns `true`. To check for NaNs, pass the same variable as both arguments (i.e., `dlaisnan( x, x )`). +- The function returns `true` whenever the two arguments are unequal, not only when one is `NaN`. This matches the Fortran reference implementation which simply returns `DIN1.NE.DIN2`. @@ -177,6 +177,8 @@ TODO [lapack-dlaisnan]: https://www.netlib.org/lapack/explore-html/d3/d22/group__laisnan_gad49d1fe3d6890e9c4f60e0429abab3c9.html +[lapack-disnan]: https://www.netlib.org/lapack/explore-html/d0/d4c/group__isnan_ga7aa3164d5df8d883754b0a70e9c7209c.html + diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js index bb1b9da587ef..5e2eb4b29344 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/benchmark/benchmark.js @@ -21,8 +21,8 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var isnan = require( '@stdlib/math/base/assert/is-nan' ); var uniform = require( '@stdlib/random/array/uniform' ); +var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; var pkg = require( './../package.json' ).name; var dlaisnan = require( './../lib' ); @@ -43,13 +43,13 @@ bench( pkg, function benchmark( b ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { z = dlaisnan( x[ i % len ], y[ i % len ] ); - if ( isnan( z ) ) { - b.fail( 'should not return NaN' ); + if ( typeof z !== 'boolean' ) { + b.fail( 'should return a boolean' ); } } b.toc(); - if ( isnan( z ) ) { - b.fail( 'should not return NaN' ); + if ( !isBoolean( z ) ) { + b.fail( 'should return a boolean' ); } b.pass( 'benchmark finished' ); b.end(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/repl.txt index 1439c27f77f5..5553849e3739 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/repl.txt +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/repl.txt @@ -1,15 +1,15 @@ {{alias}}( DIN1, DIN2 ) - Tests whether two double-precision floating-point arguments are unequal - and thus at least one is NaN. + Tests input for NaN by comparing two double-precision floating-point + arguments for inequality. Parameters ---------- DIN1: number - First number to compare. + First input number. DIN2: number - Second number to compare. + Second input number. Returns ------- diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts index 6467c096498c..def43c8a45da 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts @@ -21,8 +21,8 @@ /** * LAPACK auxiliary routine to test input for NaN by comparing two double-precision floating-point arguments for inequality. * -* @param DIN1 - first number to compare -* @param DIN2 - second number to compare +* @param DIN1 - first input number +* @param DIN2 - second input number * @returns boolean indicating whether the arguments are unequal * * @example diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js index 48fd6c7ccd20..6ecbad7ad343 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/main.js @@ -21,14 +21,14 @@ // MAIN // /** -* Tests whether two double-precision floating-point arguments are unequal and thus at least one is NaN. +* Tests input for NaN by comparing two double-precision floating-point arguments for inequality. * * ## Notes * -* - This routine exists solely to avoid over-optimization in DISNAN. +* - This routine exists solely to avoid over-optimization in `disnan`. * -* @param {number} DIN1 - first number to compare -* @param {number} DIN2 - second number to compare +* @param {number} DIN1 - first input number +* @param {number} DIN2 - second input number * @returns {boolean} boolean indicating whether the arguments are unequal * * @example diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js index 08c9d58bbf96..d63c400ae447 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/test/test.js @@ -110,3 +110,30 @@ tape( 'the function returns `true` when both arguments are unequal non-NaN value t.end(); }); + +tape( 'the function returns expected values when passed the same variable as both arguments', function test( t ) { + var bool; + var x; + + x = NaN; + bool = dlaisnan( x, x ); + t.strictEqual( bool, true, 'returns expected value' ); + + x = 5.0; + bool = dlaisnan( x, x ); + t.strictEqual( bool, false, 'returns expected value' ); + + x = 0.0; + bool = dlaisnan( x, x ); + t.strictEqual( bool, false, 'returns expected value' ); + + x = -0.0; + bool = dlaisnan( x, x ); + t.strictEqual( bool, false, 'returns expected value' ); + + x = PINF; + bool = dlaisnan( x, x ); + t.strictEqual( bool, false, 'returns expected value' ); + + t.end(); +}); From f579524cb908190f402766573ddf8a2519d00a06 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Wed, 20 May 2026 07:39:06 -0700 Subject: [PATCH 4/5] chore: remove redundant keyword --- 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_pkg_readmes status: na - task: lint_markdown_docs status: na - 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/lapack/base/dlaisnan/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/package.json b/lib/node_modules/@stdlib/lapack/base/dlaisnan/package.json index a68cc4f91474..bec346c5109f 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/package.json +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/package.json @@ -63,7 +63,6 @@ "algebra", "subroutines", "float64", - "double", - "float64array" + "double" ] } From 8fac49a1047357368e30c85f7c5b36fc5cafe1a5 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Wed, 20 May 2026 07:49:07 -0700 Subject: [PATCH 5/5] docs: keep consistent examples across files --- 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_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: 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: passed - task: lint_license_headers status: passed --- --- .../@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts | 4 ++++ lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts index def43c8a45da..a42bafe5bfe6 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/docs/types/index.d.ts @@ -30,6 +30,10 @@ * // returns true * * @example +* var bool = dlaisnan( NaN, 5.0 ); +* // returns true +* +* @example * var bool = dlaisnan( 5.0, 5.0 ); * // returns false */ diff --git a/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js index 07197a771143..ba21fca5cdb5 100644 --- a/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js +++ b/lib/node_modules/@stdlib/lapack/base/dlaisnan/lib/index.js @@ -29,6 +29,9 @@ * var bool = dlaisnan( NaN, NaN ); * // returns true * +* bool = dlaisnan( NaN, 5.0 ); +* // returns true +* * bool = dlaisnan( 5.0, 5.0 ); * // returns false */