Skip to content
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
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions lib/node_modules/@stdlib/constants/lapack/dsafmin/README.md
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.
Copy link
Member

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.

Suggested change
The minimum [safe][safe] [double-precision floating-point][ieee754] integer.
The smallest positive [safe][safe] [double-precision floating-point][ieee754] number.


```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 lib/node_modules/@stdlib/constants/lapack/dsafmin/docs/repl.txt
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
--------

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;
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
}
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 );
}
}
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 lib/node_modules/@stdlib/constants/lapack/dsafmin/lib/index.js
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 lib/node_modules/@stdlib/constants/lapack/dsafmin/manifest.json
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": []
}
]
}
Loading
Loading