diff --git a/lib/node_modules/@stdlib/lapack/base/disnan/README.md b/lib/node_modules/@stdlib/lapack/base/disnan/README.md new file mode 100644 index 000000000000..3418c3f4340a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/disnan/README.md @@ -0,0 +1,174 @@ + + +# disnan + +> LAPACK auxiliary routine to test whether a double-precision floating-point number is `NaN`. + +
+ +## Usage + +```javascript +var disnan = require( '@stdlib/lapack/base/disnan' ); +``` + +#### disnan( x ) + +Tests whether a double-precision floating-point number is `NaN`. + +```javascript +var bool = disnan( NaN ); +// returns true + +bool = disnan( 5.0 ); +// returns false +``` + +The function has the following parameters: + +- **x**: input value. + +
+ + + +
+ +## Notes + +- `disnan()` corresponds to the [LAPACK][lapack] auxiliary routine [`disnan`][lapack-disnan]. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var disnan = require( '@stdlib/lapack/base/disnan' ); + +var opts = { + 'dtype': 'float64' +}; +var x = discreteUniform( 100, -50, 50, opts ); + +logEachMap( 'disnan( %d ) = %s', x, disnan ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/lapack/base/disnan/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/disnan/benchmark/benchmark.js new file mode 100644 index 000000000000..47ef7ef1e1b0 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/disnan/benchmark/benchmark.js @@ -0,0 +1,54 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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 uniform = require( '@stdlib/random/array/uniform' ); +var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var pkg = require( './../package.json' ).name; +var disnan = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var len; + var x; + var z; + var i; + + len = 100; + x = uniform( len, -50, 50 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = disnan( x[ i % len ] ); + if ( typeof z !== 'boolean' ) { + b.fail( 'should return a boolean' ); + } + } + b.toc(); + if ( !isBoolean( z ) ) { + b.fail( 'should return a boolean' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/lapack/base/disnan/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/disnan/docs/repl.txt new file mode 100644 index 000000000000..517e6eeb807b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/disnan/docs/repl.txt @@ -0,0 +1,24 @@ + +{{alias}}( x ) + Tests whether a double-precision floating-point number is NaN. + + Parameters + ---------- + x: number + Input value. + + Returns + ------- + bool: boolean + Boolean indicating whether an input value is NaN. + + Examples + -------- + > var bool = {{alias}}( NaN ) + true + > bool = {{alias}}( 5.0 ) + false + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/lapack/base/disnan/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/disnan/docs/types/index.d.ts new file mode 100644 index 000000000000..95e375a267de --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/disnan/docs/types/index.d.ts @@ -0,0 +1,40 @@ +/* +* @license Apache-2.0 +* +* 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. +* 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 + +/** +* Tests whether a double-precision floating-point number is NaN. +* +* @param x - input value +* @returns boolean indicating whether an input value is NaN +* +* @example +* var bool = disnan( NaN ); +* // returns true +* +* @example +* var bool = disnan( 5.0 ); +* // returns false +*/ +declare function disnan( x: number ): boolean; + + +// EXPORTS // + +export = disnan; diff --git a/lib/node_modules/@stdlib/lapack/base/disnan/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/disnan/docs/types/test.ts new file mode 100644 index 000000000000..b655b56ae275 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/disnan/docs/types/test.ts @@ -0,0 +1,42 @@ +/* +* @license Apache-2.0 +* +* 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. +* 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 disnan = require( './index' ); + + +// TESTS // + +// The function returns a boolean... +{ + disnan( 8 ); // $ExpectType boolean +} + +// The compiler throws an error if the function is provided a value other than a number... +{ + disnan( true ); // $ExpectError + disnan( false ); // $ExpectError + disnan( '5' ); // $ExpectError + disnan( [] ); // $ExpectError + disnan( {} ); // $ExpectError + disnan( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + disnan(); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/lapack/base/disnan/examples/index.js b/lib/node_modules/@stdlib/lapack/base/disnan/examples/index.js new file mode 100644 index 000000000000..6418760af007 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/disnan/examples/index.js @@ -0,0 +1,30 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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 disnan = require( './../lib' ); + +var opts = { + 'dtype': 'float64' +}; +var x = discreteUniform( 100, -50, 50, opts ); + +logEachMap( 'disnan( %d ) = %s', x, disnan ); diff --git a/lib/node_modules/@stdlib/lapack/base/disnan/lib/index.js b/lib/node_modules/@stdlib/lapack/base/disnan/lib/index.js new file mode 100644 index 000000000000..5db1232da25c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/disnan/lib/index.js @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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 whether a double-precision floating-point number is NaN. +* +* @module @stdlib/lapack/base/disnan +* +* @example +* var disnan = require( '@stdlib/lapack/base/disnan' ); +* +* var bool = disnan( NaN ); +* // returns true +* +* bool = disnan( 5.0 ); +* // returns false +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/lapack/base/disnan/lib/main.js b/lib/node_modules/@stdlib/lapack/base/disnan/lib/main.js new file mode 100644 index 000000000000..85f30a2f1781 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/disnan/lib/main.js @@ -0,0 +1,49 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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 dlaisnan = require( '@stdlib/lapack/base/dlaisnan' ); + + +// MAIN // + +/** +* Tests whether a double-precision floating-point number is NaN. +* +* @param {number} x - input value +* @returns {boolean} boolean indicating whether an input value is NaN +* +* @example +* var bool = disnan( NaN ); +* // returns true +* +* @example +* var bool = disnan( 5.0 ); +* // returns false +*/ +function disnan( x ) { + return dlaisnan( x, x ); +} + + +// EXPORTS // + +module.exports = disnan; diff --git a/lib/node_modules/@stdlib/lapack/base/disnan/package.json b/lib/node_modules/@stdlib/lapack/base/disnan/package.json new file mode 100644 index 000000000000..16aa188adecd --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/disnan/package.json @@ -0,0 +1,67 @@ +{ + "name": "@stdlib/lapack/base/disnan", + "version": "0.0.0", + "description": "LAPACK auxiliary routine to test whether a double-precision floating-point number is NaN.", + "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", + "disnan", + "nan", + "isnan", + "test", + "linear", + "algebra", + "subroutines", + "float64", + "double" + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/disnan/test/test.js b/lib/node_modules/@stdlib/lapack/base/disnan/test/test.js new file mode 100644 index 000000000000..6f40fa98542b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/disnan/test/test.js @@ -0,0 +1,91 @@ +/** +* @license Apache-2.0 +* +* 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. +* 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 disnan = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof disnan, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 1', function test( t ) { + t.strictEqual( disnan.length, 1, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `true` when the argument is NaN', function test( t ) { + var bool; + + bool = disnan( NaN ); + t.strictEqual( bool, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `false` when the argument is not NaN', function test( t ) { + var bool; + + bool = disnan( 5.0 ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = disnan( 0.0 ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = disnan( -0.0 ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = disnan( -3.14 ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = disnan( 100.0 ); + t.strictEqual( bool, false, 'returns expected value' ); + + bool = disnan( -100.0 ); + t.strictEqual( bool, false, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `false` when the argument is positive infinity', function test( t ) { + var bool; + + bool = disnan( PINF ); + t.strictEqual( bool, false, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `false` when the argument is negative infinity', function test( t ) { + var bool; + + bool = disnan( NINF ); + t.strictEqual( bool, false, 'returns expected value' ); + + t.end(); +});