Skip to content

feat: add constants/lapack/dsafmin #2859

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

Open
wants to merge 4 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) 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.

-->

# FLOAT64_LAPACK_SAFE_MIN

> Smallest positive [safe][safe] [double-precision floating-point][ieee754] number.

<section class="usage">

## Usage

```javascript
var FLOAT64_LAPACK_SAFE_MIN = require( '@stdlib/constants/lapack/dsafmin' );
```

#### FLOAT64_LAPACK_SAFE_MIN

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 smallest positive [safe][safe] [double-precision floating-point][ieee754] number.

</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}}
Smallest positive safe double-precision floating-point number.

The smallest positive safe double-precision floating-point number 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) 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

/**
* Smallest positive safe double-precision floating-point number.
*
* @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) 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 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) 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 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) 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.
*/

#ifndef STDLIB_CONSTANTS_FLOAT64_LAPACK_SAFE_MIN_H
#define STDLIB_CONSTANTS_FLOAT64_LAPACK_SAFE_MIN_H

/**
* Macro for the smallest positive safe double-precision floating-point number.
*/
#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) 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';

/**
* Smallest positive safe double-precision floating-point number.
*
* @module @stdlib/constants/lapack/dsafmin
* @type {number}
*
* @example
* var FLOAT64_LAPACK_SAFE_MIN = require( '@stdlib/constants/lapack/dsafmin' );
* // returns 2.22507385850720138e-308
*/


// MAIN //

/**
* Smallest positive safe double-precision floating-point number.
*
* ## 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