Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jan 14, 2024
1 parent 9cc536a commit 5748774
Show file tree
Hide file tree
Showing 24 changed files with 1,223 additions and 304 deletions.
604 changes: 304 additions & 300 deletions dist/index.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/index.js.map

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions float32/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ setReadOnly( constants, 'MAX_SAFE_INTEGER', require( './../../float32/max-safe-i
*/
setReadOnly( constants, 'MIN_SAFE_INTEGER', require( './../../float32/min-safe-integer' ) );

/**
* @name NAN
* @memberof constants
* @readonly
* @constant
* @type {number}
* @see {@link module:@stdlib/constants/float32/nan}
*/
setReadOnly( constants, 'NAN', require( './../../float32/nan' ) );

/**
* @name NINF
* @memberof constants
Expand Down
135 changes: 135 additions & 0 deletions float32/nan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<!--
@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.
-->

# NAN

> [Single-precision floating-point][ieee754] `NaN`.
<section class="usage">

## Usage

```javascript
var FLOAT32_NAN = require( '@stdlib/constants/float32/nan' );
```

#### FLOAT32_NAN

[Single-precision floating-point][ieee754] `NaN`.

```javascript
var bool = ( FLOAT32_NAN !== FLOAT32_NAN );
// returns true
```

</section>

<!-- /.usage -->

<section class="examples">

## Examples

<!-- TODO: better example -->

<!-- eslint no-undef: "error" -->

```javascript
var FLOAT32_NAN = require( '@stdlib/constants/float32/nan' );

console.log( FLOAT32_NAN );
// => NaN
```

</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/float32/nan.h"
```

#### STDLIB_CONSTANT_FLOAT32_NAN

Macro for [single-precision floating-point][ieee754] NaN.

</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">

</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">

[ieee754]: https://en.wikipedia.org/wiki/IEEE_754-1985

</section>

<!-- /.links -->
12 changes: 12 additions & 0 deletions float32/nan/docs/repl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

{{alias}}
Single-precision floating-point NaN.

Examples
--------
> {{alias}}
NaN

See Also
--------

33 changes: 33 additions & 0 deletions float32/nan/docs/types/index.d.ts
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

/**
* Single-precision floating-point NaN.
*
* @example
* var nan = FLOAT32_NAN;
* // returns NaN
*/
declare const FLOAT32_NAN: number;


// EXPORTS //

export = FLOAT32_NAN;
28 changes: 28 additions & 0 deletions float32/nan/docs/types/test.ts
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 FLOAT32_NAN = require( './index' );


// TESTS //

// The export is a number...
{
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
FLOAT32_NAN; // $ExpectType number
}
24 changes: 24 additions & 0 deletions float32/nan/examples/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @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 FLOAT32_NAN = require( './../lib' );

console.log( FLOAT32_NAN );
// => NaN
27 changes: 27 additions & 0 deletions float32/nan/include/stdlib/constants/float32/nan.h
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_FLOAT32_NAN_H
#define STDLIB_CONSTANTS_FLOAT32_NAN_H

/**
* Macro for single-precision floating-point NaN.
*/
#define STDLIB_CONSTANT_FLOAT32_NAN 0.0f/0.0f

#endif // !STDLIB_CONSTANTS_FLOAT32_NAN_H
48 changes: 48 additions & 0 deletions float32/nan/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* @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';

/**
* Single-precision floating-point NaN.
*
* @module @stdlib/constants/float32/nan
* @type {number}
*
* @example
* var FLOAT32_NAN = require( '@stdlib/constants/float32/nan' );
* // returns NaN
*/


// MAIN //

/**
* Single-precision floating-point NaN.
*
* @constant
* @type {number}
* @default NaN
* @see [IEEE 754]{@link https://en.wikipedia.org/wiki/IEEE_754-1985}
*/
var FLOAT32_NAN = NaN;


// EXPORTS //

module.exports = FLOAT32_NAN;
36 changes: 36 additions & 0 deletions float32/nan/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

0 comments on commit 5748774

Please sign in to comment.