-
-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add constants/lapack/dsafmin
#2859
Open
Pranavchiku
wants to merge
2
commits into
stdlib-js:develop
Choose a base branch
from
Pranavchiku:dsafmin
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
153 changes: 153 additions & 0 deletions
153
lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
<!-- | ||
|
||
@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. | ||
|
||
--> | ||
|
||
# FLOAT64_LAPACK_SAFE_MIN | ||
|
||
> Minimum safe [double-precision floating-point][ieee754] integer. | ||
|
||
<section class="usage"> | ||
|
||
## 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 | ||
``` | ||
|
||
</section> | ||
|
||
<!-- /.usage --> | ||
|
||
<section class="examples"> | ||
|
||
## Examples | ||
|
||
<!-- eslint no-undef: "error" --> | ||
|
||
```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 ); | ||
} | ||
} | ||
``` | ||
|
||
</section> | ||
|
||
<!-- /.examples --> | ||
|
||
<!-- C interface documentation. --> | ||
|
||
* * * | ||
|
||
<section class="c"> | ||
|
||
## C APIs | ||
|
||
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --> | ||
|
||
<section class="intro"> | ||
|
||
</section> | ||
|
||
<!-- /.intro --> | ||
|
||
<!-- C usage documentation. --> | ||
|
||
<section class="usage"> | ||
|
||
### 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. | ||
|
||
</section> | ||
|
||
<!-- /.usage --> | ||
|
||
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> | ||
|
||
<section class="notes"> | ||
|
||
</section> | ||
|
||
<!-- /.notes --> | ||
|
||
<!-- C API usage examples. --> | ||
|
||
<section class="examples"> | ||
|
||
</section> | ||
|
||
<!-- /.examples --> | ||
|
||
</section> | ||
|
||
<!-- /.c --> | ||
|
||
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --> | ||
|
||
<section class="related"> | ||
|
||
* * * | ||
|
||
## See Also | ||
|
||
</section> | ||
|
||
<!-- /.related --> | ||
|
||
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> | ||
|
||
<section class="links"> | ||
|
||
[safe]: https://www.netlib.org/lapack/explore-html/d4/d69/namespacela__constants_a7ae97fc519ab76a576db113b17312382.html#a7ae97fc519ab76a576db113b17312382 | ||
|
||
[ieee754]: https://en.wikipedia.org/wiki/IEEE_754-1985 | ||
|
||
<!-- <related-links> --> | ||
|
||
<!-- </related-links> --> | ||
|
||
</section> | ||
|
||
<!-- /.links --> |
15 changes: 15 additions & 0 deletions
15
lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/repl.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
-------- | ||
|
33 changes: 33 additions & 0 deletions
33
lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/types/index.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
28 changes: 28 additions & 0 deletions
28
lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/types/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
34 changes: 34 additions & 0 deletions
34
lib/node_modules/@stdlib/constants/lapack/dsafmin/examples/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...dules/@stdlib/constants/lapack/dsafmin/include/stdlib/constants/float64/lapack_safe_min.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
55 changes: 55 additions & 0 deletions
55
lib/node_modules/@stdlib/constants/lapack/dsafmin/lib/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
36 changes: 36 additions & 0 deletions
36
lib/node_modules/@stdlib/constants/lapack/dsafmin/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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": [] | ||
} | ||
] | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the description should be changed here and elsewhere to e.g.