From 6a0830a0687ac77bf2ea285ea84a82bd83b9b602 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Tue, 3 Sep 2024 11:58:22 +0530 Subject: [PATCH 1/2] feat: add constants/lapack/dsafmin --- .../constants/lapack/dsafmin/README.md | 153 ++++++++++++++++++ .../constants/lapack/dsafmin/docs/repl.txt | 15 ++ .../lapack/dsafmin/docs/types/index.d.ts | 33 ++++ .../lapack/dsafmin/docs/types/test.ts | 28 ++++ .../lapack/dsafmin/examples/index.js | 34 ++++ .../constants/float64/lapack_safe_min.h | 27 ++++ .../constants/lapack/dsafmin/lib/index.js | 55 +++++++ .../constants/lapack/dsafmin/manifest.json | 36 +++++ .../constants/lapack/dsafmin/package.json | 69 ++++++++ .../constants/lapack/dsafmin/test/test.js | 38 +++++ 10 files changed, 488 insertions(+) create mode 100644 lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md create mode 100644 lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/constants/lapack/dsafmin/examples/index.js create mode 100644 lib/node_modules/@stdlib/constants/lapack/dsafmin/include/stdlib/constants/float64/lapack_safe_min.h create mode 100644 lib/node_modules/@stdlib/constants/lapack/dsafmin/lib/index.js create mode 100644 lib/node_modules/@stdlib/constants/lapack/dsafmin/manifest.json create mode 100644 lib/node_modules/@stdlib/constants/lapack/dsafmin/package.json create mode 100644 lib/node_modules/@stdlib/constants/lapack/dsafmin/test/test.js diff --git a/lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md b/lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md new file mode 100644 index 00000000000..e8648d8716c --- /dev/null +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md @@ -0,0 +1,153 @@ + + +# FLOAT64_LAPACK_SAFE_MIN + +> Minimum safe [double-precision floating-point][ieee754] integer. + +
+ +## Usage + +```javascript +var FLOAT64_LAPACK_SAFE_MIN = require( '@stdlib/constants/lapack/dsafmin' ); +``` + +#### FLOAT64_LAPACK_SAFE_MIN + +The minimum [safe][safe] [double-precision floating-point][ieee754] integer. + +```javascript +var bool = ( FLOAT64_LAPACK_SAFE_MIN === 2.22507385850720138e-308 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + +```javascript +var randu = require( '@stdlib/random/base/randu' ); +var FLOAT64_LAPACK_SAFE_MIN = require( '@stdlib/constants/lapack/dsafmin' ); + +var x; +var i; + +for ( i = 0; i < 100; i++ ) { + x = ( randu() * 100 ) - 50; + if ( x < FLOAT64_LAPACK_SAFE_MIN ) { + console.log( 'Unsafe: %d', x ); + } else { + console.log( 'Safe: %d', x ); + } +} +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float64/lapack_safe_min.h" +``` + +#### STDLIB_CONSTANT_FLOAT64_LAPACK_SAFE_MIN + +Macro for the minimum [safe][safe] [double-precision floating-point][ieee754] integer. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/repl.txt b/lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/repl.txt new file mode 100644 index 00000000000..3a39828a9a9 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/repl.txt @@ -0,0 +1,15 @@ + +{{alias}} + Minimum safe double-precision floating-point integer. + + The minimum safe double-precision floating-point integer is given by + `real(radix(0._dp),dp)**max(minexponent(0._dp)-1, 1-maxexponent(0._dp))`. + + Examples + -------- + > {{alias}} + 2.22507385850720138e-308 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/types/index.d.ts b/lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/types/index.d.ts new file mode 100644 index 00000000000..345b1cb0b0f --- /dev/null +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/types/index.d.ts @@ -0,0 +1,33 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 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 + +/** +* Minimum safe double-precision floating-point integer. +* +* @example +* var min = FLOAT64_LAPACK_SAFE_MIN; +* // returns 2.22507385850720138e-308 +*/ +declare const FLOAT64_LAPACK_SAFE_MIN: number; + + +// EXPORTS // + +export = FLOAT64_LAPACK_SAFE_MIN; diff --git a/lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/types/test.ts b/lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/types/test.ts new file mode 100644 index 00000000000..f8f916350ce --- /dev/null +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/types/test.ts @@ -0,0 +1,28 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 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 FLOAT64_LAPACK_SAFE_MIN = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT64_LAPACK_SAFE_MIN; // $ExpectType number +} diff --git a/lib/node_modules/@stdlib/constants/lapack/dsafmin/examples/index.js b/lib/node_modules/@stdlib/constants/lapack/dsafmin/examples/index.js new file mode 100644 index 00000000000..80eeb03fe01 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/examples/index.js @@ -0,0 +1,34 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 randu = require( '@stdlib/random/base/randu' ); +var FLOAT64_LAPACK_SAFE_MIN = require( './../lib' ); + +var x; +var i; + +for ( i = 0; i < 100; i++ ) { + x = ( randu() * 100 ) - 50; + if ( x < FLOAT64_LAPACK_SAFE_MIN ) { + console.log( 'Unsafe: %d', x ); + } else { + console.log( 'Safe: %d', x ); + } +} diff --git a/lib/node_modules/@stdlib/constants/lapack/dsafmin/include/stdlib/constants/float64/lapack_safe_min.h b/lib/node_modules/@stdlib/constants/lapack/dsafmin/include/stdlib/constants/float64/lapack_safe_min.h new file mode 100644 index 00000000000..c2d8753710c --- /dev/null +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/include/stdlib/constants/float64/lapack_safe_min.h @@ -0,0 +1,27 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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_FLOAT64_LAPACK_SAFE_MIN_H +#define STDLIB_CONSTANTS_FLOAT64_LAPACK_SAFE_MIN_H + +/** +* Macro for the minimum safe double-precision floating-point integer. +*/ +#define STDLIB_CONSTANT_FLOAT64_LAPACK_SAFE_MIN 2.22507385850720138e-308 + +#endif // !STDLIB_CONSTANTS_FLOAT64_LAPACK_SAFE_MIN_H diff --git a/lib/node_modules/@stdlib/constants/lapack/dsafmin/lib/index.js b/lib/node_modules/@stdlib/constants/lapack/dsafmin/lib/index.js new file mode 100644 index 00000000000..6ae6355ee9b --- /dev/null +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/lib/index.js @@ -0,0 +1,55 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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'; + +/** +* Minimum safe double-precision floating-point integer. +* +* @module @stdlib/constants/lapack/dsafmin +* @type {number} +* +* @example +* var FLOAT64_LAPACK_SAFE_MIN = require( '@stdlib/constants/lapack/dsafmin' ); +* // returns 2.22507385850720138e-308 +*/ + + +// MAIN // + +/** +* Minimum safe double-precision floating-point integer. +* +* ## Notes +* +* The number has the value +* +* ```tex +* real(radix(0._dp),dp)**max(minexponent(0._dp)-1, 1-maxexponent(0._dp)) +* ``` +* +* @constant +* @type {number} +* @default 2.22507385850720138e-308 +*/ +var FLOAT64_LAPACK_SAFE_MIN = 2.22507385850720138e-308; + + +// EXPORTS // + +module.exports = FLOAT64_LAPACK_SAFE_MIN; diff --git a/lib/node_modules/@stdlib/constants/lapack/dsafmin/manifest.json b/lib/node_modules/@stdlib/constants/lapack/dsafmin/manifest.json new file mode 100644 index 00000000000..844d692f643 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/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/lapack/dsafmin/package.json b/lib/node_modules/@stdlib/constants/lapack/dsafmin/package.json new file mode 100644 index 00000000000..6566f250501 --- /dev/null +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/constants/lapack/dsafmin", + "version": "0.0.0", + "description": "Minimum safe double-precision floating-point integer.", + "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", + "min", + "minimum", + "safe", + "integer", + "double", + "dbl", + "floating", + "point", + "floating-point", + "float", + "float64", + "ieee754" + ] +} diff --git a/lib/node_modules/@stdlib/constants/lapack/dsafmin/test/test.js b/lib/node_modules/@stdlib/constants/lapack/dsafmin/test/test.js new file mode 100644 index 00000000000..4162f04d41f --- /dev/null +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/test/test.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 FLOAT64_LAPACK_SAFE_MIN = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a number', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof FLOAT64_LAPACK_SAFE_MIN, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'the exported value is 2.22507385850720138e-308', function test( t ) { + t.equal( FLOAT64_LAPACK_SAFE_MIN, 2.22507385850720138e-308, 'returns 2.22507385850720138e-308' ); + t.end(); +}); From 70274642de8a33ca3a09c4b1e7654acf97722c8c Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Tue, 3 Sep 2024 12:00:59 +0530 Subject: [PATCH 2/2] fix: license year in readme file --- lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md b/lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md index e8648d8716c..7ca0f9313e4 100644 --- a/lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md +++ b/lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2018 The Stdlib Authors. +Copyright (c) 2024 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.