Skip to content
Draft
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
103 changes: 103 additions & 0 deletions lib/node_modules/@stdlib/number/float16/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<!--

@license Apache-2.0

Copyright (c) 2026 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.

-->

# Float16

> Utilities for half-precision floating-point numbers.

<section class="usage">

## Usage

```javascript
var ns = require( '@stdlib/number/float16' );
```

#### ns

Utilities for half-precision floating-point numbers.

```javascript
var o = ns;
// returns {...}
```

The namespace contains the following:

<!-- <toc pattern="*"> -->

<div class="namespace-toc">

- <span class="signature">[`base`][@stdlib/number/float16/base]</span><span class="delimiter">: </span><span class="description">base utilities for half-precision floating-point numbers.</span>
- <span class="signature">[`reviver( key, value )`][@stdlib/number/float16/reviver]</span><span class="delimiter">: </span><span class="description">revive a JSON-serialized number.</span>
- <span class="signature">[`toJSON( x )`][@stdlib/number/float16/to-json]</span><span class="delimiter">: </span><span class="description">return a JSON representation of a number.</span>

</div>

<!-- </toc> -->

</section>

<!-- /.usage -->

<section class="examples">

## Examples

<!-- TODO: better examples -->

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

```javascript
var objectKeys = require( '@stdlib/utils/keys' );
var ns = require( '@stdlib/number/float16' );

console.log( objectKeys( ns ) );
```

</section>

<!-- /.examples -->

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

<!-- <toc-links> -->

[@stdlib/number/float16/base]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/number/float16/base

[@stdlib/number/float16/reviver]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/number/float16/reviver

[@stdlib/number/float16/to-json]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/number/float16/to-json

<!-- </toc-links> -->

</section>

<!-- /.links -->
74 changes: 74 additions & 0 deletions lib/node_modules/@stdlib/number/float16/docs/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* @license Apache-2.0
*
* Copyright (c) 2026 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

/* eslint-disable max-lines */

import base = require( '@stdlib/number/float16/base' );
import reviver = require( '@stdlib/number/float16/reviver' );
import toJSON = require( '@stdlib/number/float16/to-json' );

/**
* Interface describing the `float16` namespace.
*/
interface Namespace {
/**
* Base utilities for half-precision floating-point numbers.
*/
base: typeof base;

/**
* Revives a JSON-serialized number.
*
* @param key - key
* @param value - value
* @returns value
*
* @example
* var parseJSON = require( '@stdlib/utils/parse-json' );
*
* var str = '{"type":"float16","value":"NaN"}';
*
* var out = parseJSON( str, ns.reviver );
* // returns NaN
*/
reviver: typeof reviver;

/**
* Returns a JSON representation of a number.
*
* @param x - input value
* @returns JSON representation
*
* @example
* var str = JSON.stringify( ns.toJSON( NaN ) );
* // returns '{"type":"float16","value":"NaN"}'
*/
toJSON: typeof toJSON;
}

/**
* Utilities for half-precision floating-point numbers.
*/
declare var ns: Namespace;


// EXPORTS //

export = ns;
29 changes: 29 additions & 0 deletions lib/node_modules/@stdlib/number/float16/docs/types/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* @license Apache-2.0
*
* Copyright (c) 2026 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.
*/

/* eslint-disable @typescript-eslint/no-unused-expressions */

import ns = require( './index' );


// TESTS //

// The exported value is the expected interface...
{
ns; // $ExpectType Namespace
}
24 changes: 24 additions & 0 deletions lib/node_modules/@stdlib/number/float16/examples/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 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 objectKeys = require( '@stdlib/utils/keys' );
var ns = require( './../lib' );

console.log( objectKeys( ns ) );
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 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_NUMBER_FLOAT16_H
#define STDLIB_NUMBER_FLOAT16_H

// Note: keep in alphabetical order...
#include "stdlib/number/float16/ctor.h"
#include "stdlib/number/float16/base/exponent.h"
#include "stdlib/number/float16/base/from_word.h"
#include "stdlib/number/float16/base/signbit.h"
#include "stdlib/number/float16/base/significand.h"
#include "stdlib/number/float16/base/to_float32.h"
#include "stdlib/number/float16/base/to_float64.h"
#include "stdlib/number/float16/base/to_word.h"

#endif // !STDLIB_NUMBER_FLOAT16_H
78 changes: 78 additions & 0 deletions lib/node_modules/@stdlib/number/float16/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 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';

/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
*/

// MODULES //

var setReadOnly = require( '@stdlib/utils/define-read-only-property' );


// MAIN //

/**
* Top-level namespace.
*
* @namespace ns
*/
var ns = {};

/**
* @name base
* @memberof ns
* @readonly
* @type {Namespace}
* @see {@link module:@stdlib/number/float16/base}
*/
setReadOnly( ns, 'base', require( '@stdlib/number/float16/base' ) );

Check failure on line 46 in lib/node_modules/@stdlib/number/float16/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

cannot resolve module: "@stdlib/number/float16/base"

/**
* @name ctor
* @memberof ns
* @readonly
* @type {Namespace}
* @see {@link module:@stdlib/number/float16/ctor}
*/
setReadOnly( ns, 'ctor', require( '@stdlib/number/float16/ctor' ) );

/**
* @name reviver
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/number/float16/reviver}
*/
setReadOnly( ns, 'reviver', require( '@stdlib/number/float16/reviver' ) );

Check failure on line 64 in lib/node_modules/@stdlib/number/float16/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

cannot resolve module: "@stdlib/number/float16/reviver"

/**
* @name toJSON
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/number/float16/to-json}
*/
setReadOnly( ns, 'toJSON', require( '@stdlib/number/float16/to-json' ) );

Check failure on line 73 in lib/node_modules/@stdlib/number/float16/lib/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

cannot resolve module: "@stdlib/number/float16/to-json"


// EXPORTS //

module.exports = ns;
45 changes: 45 additions & 0 deletions lib/node_modules/@stdlib/number/float16/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"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": [
"@stdlib/number/float16/ctor",
"@stdlib/number/float16/base/exponent",
"@stdlib/number/float16/base/from-word",
"@stdlib/number/float16/base/signbit",
"@stdlib/number/float16/base/significand",
"@stdlib/number/float16/base/to-float32",
"@stdlib/number/float16/base/to-float64",
"@stdlib/number/float16/base/to-word"
]
}
]
}
Loading
Loading