diff --git a/lib/node_modules/@stdlib/number/float16/README.md b/lib/node_modules/@stdlib/number/float16/README.md new file mode 100644 index 000000000000..3f6c4dbe13ba --- /dev/null +++ b/lib/node_modules/@stdlib/number/float16/README.md @@ -0,0 +1,103 @@ + + +# Float16 + +> Utilities for half-precision floating-point numbers. + +
+ +## 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: + + + +
+ +- [`base`][@stdlib/number/float16/base]: base utilities for half-precision floating-point numbers. +- [`reviver( key, value )`][@stdlib/number/float16/reviver]: revive a JSON-serialized number. +- [`toJSON( x )`][@stdlib/number/float16/to-json]: return a JSON representation of a number. + +
+ + + +
+ + + +
+ +## Examples + + + + + +```javascript +var objectKeys = require( '@stdlib/utils/keys' ); +var ns = require( '@stdlib/number/float16' ); + +console.log( objectKeys( ns ) ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/number/float16/docs/types/index.d.ts b/lib/node_modules/@stdlib/number/float16/docs/types/index.d.ts new file mode 100644 index 000000000000..69ec5ac0853c --- /dev/null +++ b/lib/node_modules/@stdlib/number/float16/docs/types/index.d.ts @@ -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; diff --git a/lib/node_modules/@stdlib/number/float16/docs/types/test.ts b/lib/node_modules/@stdlib/number/float16/docs/types/test.ts new file mode 100644 index 000000000000..bbdf4147b91e --- /dev/null +++ b/lib/node_modules/@stdlib/number/float16/docs/types/test.ts @@ -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 +} diff --git a/lib/node_modules/@stdlib/number/float16/examples/index.js b/lib/node_modules/@stdlib/number/float16/examples/index.js new file mode 100644 index 000000000000..8e89f7039b55 --- /dev/null +++ b/lib/node_modules/@stdlib/number/float16/examples/index.js @@ -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 ) ); diff --git a/lib/node_modules/@stdlib/number/float16/include/stdlib/number/float16.h b/lib/node_modules/@stdlib/number/float16/include/stdlib/number/float16.h new file mode 100644 index 000000000000..bcde9a7517a3 --- /dev/null +++ b/lib/node_modules/@stdlib/number/float16/include/stdlib/number/float16.h @@ -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 diff --git a/lib/node_modules/@stdlib/number/float16/lib/index.js b/lib/node_modules/@stdlib/number/float16/lib/index.js new file mode 100644 index 000000000000..2e485f4944d2 --- /dev/null +++ b/lib/node_modules/@stdlib/number/float16/lib/index.js @@ -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' ) ); + +/** +* @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' ) ); + +/** +* @name toJSON +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/number/float16/to-json} +*/ +setReadOnly( ns, 'toJSON', require( '@stdlib/number/float16/to-json' ) ); + + +// EXPORTS // + +module.exports = ns; diff --git a/lib/node_modules/@stdlib/number/float16/manifest.json b/lib/node_modules/@stdlib/number/float16/manifest.json new file mode 100644 index 000000000000..65a49269a71f --- /dev/null +++ b/lib/node_modules/@stdlib/number/float16/manifest.json @@ -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" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/number/float16/package.json b/lib/node_modules/@stdlib/number/float16/package.json new file mode 100644 index 000000000000..70fa87a032c7 --- /dev/null +++ b/lib/node_modules/@stdlib/number/float16/package.json @@ -0,0 +1,67 @@ +{ + "name": "@stdlib/number/float16", + "version": "0.0.0", + "description": "Utilities for half-precision floating-point numbers.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "lib/index.js", + "directories": { + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdtypes", + "types", + "data", + "structure", + "floating-point", + "float16", + "16-bit", + "integer", + "float", + "half", + "half-precision", + "ieee754", + "addon" + ] +} diff --git a/lib/node_modules/@stdlib/number/float16/test/test.js b/lib/node_modules/@stdlib/number/float16/test/test.js new file mode 100644 index 000000000000..c831c8ad23dc --- /dev/null +++ b/lib/node_modules/@stdlib/number/float16/test/test.js @@ -0,0 +1,40 @@ +/** +* @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'; + +// MODULES // + +var tape = require( 'tape' ); +var objectKeys = require( '@stdlib/utils/keys' ); +var ns = require( './../lib' ); + + +// TESTS // + +tape( 'main export is an object', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof ns, 'object', 'main export is an object' ); + t.end(); +}); + +tape( 'the exported object contains key-value pairs', function test( t ) { + var keys = objectKeys( ns ); + t.strictEqual( keys.length > 0, true, 'has keys' ); + t.end(); +});