From a915b56c0d034d8f6e6ab3a92c3991cbc458e2f0 Mon Sep 17 00:00:00 2001 From: Samarth Kolarkar Date: Fri, 28 Aug 2026 14:00:38 +0530 Subject: [PATCH 1/5] feat: add @stdlib/assert/is-same-float16array --- .../@stdlib/assert/docs/types/index.d.ts | 32 +++++ .../assert/is-same-float16array/README.md | 127 ++++++++++++++++++ .../benchmark/benchmark.length.js | 98 ++++++++++++++ .../assert/is-same-float16array/docs/repl.txt | 35 +++++ .../docs/types/index.d.ts | 55 ++++++++ .../is-same-float16array/docs/types/test.ts | 36 +++++ .../is-same-float16array/examples/index.js | 40 ++++++ .../assert/is-same-float16array/lib/index.js | 54 ++++++++ .../assert/is-same-float16array/lib/main.js | 61 +++++++++ .../assert/is-same-float16array/package.json | 77 +++++++++++ .../assert/is-same-float16array/test/test.js | 109 +++++++++++++++ lib/node_modules/@stdlib/assert/lib/index.js | 9 ++ 12 files changed, 733 insertions(+) create mode 100644 lib/node_modules/@stdlib/assert/is-same-float16array/README.md create mode 100644 lib/node_modules/@stdlib/assert/is-same-float16array/benchmark/benchmark.length.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-float16array/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/assert/is-same-float16array/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/assert/is-same-float16array/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/assert/is-same-float16array/examples/index.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-float16array/lib/index.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-float16array/lib/main.js create mode 100644 lib/node_modules/@stdlib/assert/is-same-float16array/package.json create mode 100644 lib/node_modules/@stdlib/assert/is-same-float16array/test/test.js diff --git a/lib/node_modules/@stdlib/assert/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/docs/types/index.d.ts index a6f2f2b021aa..fc5d52aef99e 100644 --- a/lib/node_modules/@stdlib/assert/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/docs/types/index.d.ts @@ -306,6 +306,7 @@ import isSameComplex64 = require( '@stdlib/assert/is-same-complex64' ); import isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); import isSameComplex128 = require( '@stdlib/assert/is-same-complex128' ); import isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); +import isSameFloat16Array = require( '@stdlib/assert/is-same-float16array' ); import isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); import isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); import isSameNativeClass = require( '@stdlib/assert/is-same-native-class' ); @@ -7008,6 +7009,37 @@ interface Namespace { */ isSameComplex128Array: typeof isSameComplex128Array; + /** + * Tests if two arguments are both Float16Arrays and have the same values. + * + * ## Notes + * + * - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. + * + * @param v1 - first input value + * @param v2 - second input value + * @returns boolean indicating whether two arguments are the same + * + * @example + * var Float16Array = require( '@stdlib/array/float16' ); + * + * var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); + * var y = new Float16Array( [ 1.0, 2.0, 3.0 ] ); + * + * var out = ns.isSameFloat16Array( x, y ); + * // returns true + * + * @example + * var Float16Array = require( '@stdlib/array/float16' ); + * + * var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); + * var y = new Float16Array( [ 1.0, 2.0, 4.0 ] ); + * + * var out = ns.isSameFloat16Array( x, y ); + * // returns false + * */ + isSameFloat16Array: typeof isSameFloat16Array; + /** * Tests if two arguments are both Float32Arrays and have the same values. * diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/README.md b/lib/node_modules/@stdlib/assert/is-same-float16array/README.md new file mode 100644 index 000000000000..eb43d1d6fde8 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/README.md @@ -0,0 +1,127 @@ + + +# isSameFloat16Array + +> Test if two arguments are both [Float16Arrays][@stdlib/array/float16] and have the [same values][@stdlib/assert/is-same-value]. + +
+ +## Usage + +```javascript +var isSameFloat16Array = require( '@stdlib/assert/is-same-float16array' ); +``` + +#### isSameFloat16Array( v1, v2 ) + +Tests if two arguments are both [Float16Arrays][@stdlib/array/float16] and have the [same values][@stdlib/assert/is-same-value]. + +```javascript +var Float16Array = require( '@stdlib/array/float16' ); + +var x = new Float16Array( [ 1.0, 2.0 ] ); +var y = new Float16Array( [ 1.0, 2.0 ] ); +var bool = isSameFloat16Array( x, y ); +// returns true + +bool = isSameFloat16Array( x, [ 1.0, 2.0 ] ); +// returns false +``` + +
+ + + +
+ +## Notes + +- In contrast to the strict equality operator `===`, the function distinguishes between `+0` and `-0` and treats `NaNs` as the [same value][@stdlib/assert/is-same-value]. + +
+ + + +
+ +## Examples + + + +```javascript +var Float16Array = require( '@stdlib/array/float16' ); +var isSameFloat16Array = require( '@stdlib/assert/is-same-float16array' ); + +var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +var y = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +var out = isSameFloat16Array( x, y ); +// returns true + +x = new Float16Array( [ -0.0, 0.0, -0.0 ] ); +y = new Float16Array( [ 0.0, -0.0, 0.0 ] ); +out = isSameFloat16Array( x, y ); +// returns false + +x = new Float16Array( [ NaN, NaN, NaN ] ); +y = new Float16Array( [ NaN, NaN, NaN ] ); +out = isSameFloat16Array( x, y ); +// returns true +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/benchmark/benchmark.length.js b/lib/node_modules/@stdlib/assert/is-same-float16array/benchmark/benchmark.length.js new file mode 100644 index 000000000000..99ee6f00f940 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/benchmark/benchmark.length.js @@ -0,0 +1,98 @@ +/** +* @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 bench = require( '@stdlib/bench' ); +var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var pow = require( '@stdlib/math/base/special/pow' ); +var zeroTo = require( '@stdlib/array/base/zero-to' ); +var Float16Array = require( '@stdlib/array/float16' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var isSameFloat16Array = require( './../lib' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var x = new Float16Array( zeroTo( len ) ); + var y = new Float16Array( zeroTo( len ) ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var bool; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + bool = isSameFloat16Array( x, y ); + if ( typeof bool !== 'boolean' ) { + b.fail( 'should return a boolean' ); + } + } + b.toc(); + if ( !isBoolean( bool ) ) { + b.fail( 'should return a boolean' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/docs/repl.txt b/lib/node_modules/@stdlib/assert/is-same-float16array/docs/repl.txt new file mode 100644 index 000000000000..56172313d4c5 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/docs/repl.txt @@ -0,0 +1,35 @@ + +{{alias}}( v1, v2 ) + Tests if two arguments are both Float16Arrays and have the same values. + + The function differs from the `===` operator in that the function treats + `-0` and `+0` as distinct and `NaNs` as the same. + + Parameters + ---------- + v1: any + First input value. + + v2: any + Second input value. + + Returns + ------- + bool: boolean + Boolean indicating whether two arguments are the same. + + Examples + -------- + > var x = new {{alias:@stdlib/array/float16}}( [ 1.0, 2.0, 3.0 ] ); + > var y = new {{alias:@stdlib/array/float16}}( [ 1.0, 2.0, 3.0 ] ); + > var bool = {{alias}}( x, y ) + true + + > x = new {{alias:@stdlib/array/float16}}( [ NaN, NaN, NaN ] ); + > y = new {{alias:@stdlib/array/float16}}( [ NaN, NaN, NaN ] ); + > bool = {{alias}}( x, y ) + true + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/is-same-float16array/docs/types/index.d.ts new file mode 100644 index 000000000000..5518a195fdd2 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/docs/types/index.d.ts @@ -0,0 +1,55 @@ +/* +* @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 + +/** +* Tests if two arguments are both Float16Arrays and have the same values. +* +* ## Notes +* +* - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. +* +* @param v1 - first input value +* @param v2 - second input value +* @returns boolean indicating whether two arguments are the same +* +* @example +* var Float16Array = require( '@stdlib/array/float16' ); +* +* var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +* +* var out = isSameFloat16Array( x, y ); +* // returns true +* +* @example +* var Float16Array = require( '@stdlib/array/float16' ); +* +* var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float16Array( [ 1.0, 2.0, 4.0 ] ); +* +* var out = isSameFloat16Array( x, y ); +* // returns false +*/ +declare function isSameFloat16Array( v1: any, v2: any ): boolean; + + +// EXPORTS // + +export = isSameFloat16Array; diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/docs/types/test.ts b/lib/node_modules/@stdlib/assert/is-same-float16array/docs/types/test.ts new file mode 100644 index 000000000000..3126125576f6 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/docs/types/test.ts @@ -0,0 +1,36 @@ +/* +* @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. +*/ + +import isSameFloat16Array = require( './index' ); + + +// TESTS // + +// The function returns a boolean... +{ + isSameFloat16Array( 3.14, 3.14 ); // $ExpectType boolean + isSameFloat16Array( null, null ); // $ExpectType boolean + isSameFloat16Array( 'beep', 'boop' ); // $ExpectType boolean +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + isSameFloat16Array(); // $ExpectError + isSameFloat16Array( 3.14 ); // $ExpectError + isSameFloat16Array( 'beep', 'beep', 3.14 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/examples/index.js b/lib/node_modules/@stdlib/assert/is-same-float16array/examples/index.js new file mode 100644 index 000000000000..cd56a6770cac --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/examples/index.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'; + +var Float16Array = require( '@stdlib/array/float16' ); +var isSameFloat16Array = require( './../lib' ); + +var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +var y = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +var out = isSameFloat16Array( x, y ); +console.log( out ); +// => true + +x = new Float16Array( [ -0.0, 0.0, -0.0 ] ); +y = new Float16Array( [ 0.0, -0.0, 0.0 ] ); +out = isSameFloat16Array( x, y ); +console.log( out ); +// => false + +x = new Float16Array( [ NaN, NaN, NaN ] ); +y = new Float16Array( [ NaN, NaN, NaN ] ); +out = isSameFloat16Array( x, y ); +console.log( out ); +// => true diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/lib/index.js b/lib/node_modules/@stdlib/assert/is-same-float16array/lib/index.js new file mode 100644 index 000000000000..04b89ef6b732 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/lib/index.js @@ -0,0 +1,54 @@ +/** +* @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'; + +/** +* Test if two arguments are both Float16Arrays and have the same values. +* +* @module @stdlib/assert/is-same-float16array +* +* @example +* var Float16Array = require( '@stdlib/array/float16' ); +* var isSameFloat16Array = require( '@stdlib/assert/is-same-float16array' ); +* +* var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +* +* var out = isSameFloat16Array( x, y ); +* // returns true +* +* @example +* var Float16Array = require( '@stdlib/array/float16' ); +* var isSameFloat16Array = require( '@stdlib/assert/is-same-float16array' ); +* +* var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float16Array( [ 1.0, 2.0, 4.0 ] ); +* +* var out = isSameFloat16Array( x, y ); +* // returns false +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/lib/main.js b/lib/node_modules/@stdlib/assert/is-same-float16array/lib/main.js new file mode 100644 index 000000000000..377789b40f35 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/lib/main.js @@ -0,0 +1,61 @@ +/** +* @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 isFloat16Array = require( '@stdlib/assert/is-float16array' ); +var hasSameValues = require( '@stdlib/array/base/assert/has-same-values' ); + + +// MAIN // + +/** +* Tests if two arguments are both Float16Arrays and have the same values. +* +* @param {*} v1 - first value +* @param {*} v2 - second value +* @returns {boolean} boolean result +* +* @example +* var Float16Array = require( '@stdlib/array/float16' ); +* +* var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +* +* var out = isSameFloat16Array( x, y ); +* // returns true +* +* @example +* var Float16Array = require( '@stdlib/array/float16' ); +* +* var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); +* var y = new Float16Array( [ 1.0, 2.0, 4.0 ] ); +* +* var out = isSameFloat16Array( x, y ); +* // returns false +*/ +function isSameFloat16Array( v1, v2 ) { + return ( isFloat16Array( v1 ) && isFloat16Array( v2 ) && hasSameValues( v1, v2 ) ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = isSameFloat16Array; diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/package.json b/lib/node_modules/@stdlib/assert/is-same-float16array/package.json new file mode 100644 index 000000000000..3d268fff3499 --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/package.json @@ -0,0 +1,77 @@ +{ + "name": "@stdlib/assert/is-same-float16array", + "version": "0.0.0", + "description": "Test if two arguments are both Float16Arrays and have the same values.", + "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", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "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", + "stdassert", + "assertion", + "assert", + "utilities", + "utility", + "utils", + "util", + "equal", + "same", + "strict", + "is", + "issame", + "issamevalue", + "isequal", + "isstrictequal", + "type", + "check", + "valid", + "validate", + "test", + "typed", + "array", + "float16" + ] +} diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/test/test.js b/lib/node_modules/@stdlib/assert/is-same-float16array/test/test.js new file mode 100644 index 000000000000..164902ffe4ab --- /dev/null +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/test/test.js @@ -0,0 +1,109 @@ +/** +* @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 typedarray = require( '@stdlib/array/typed' ); +var isSameFloat16Array = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof isSameFloat16Array, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns `true` if provided two Float16Arrays having the same values', function test( t ) { + var x; + var y; + + x = typedarray( [ 1.0, 2.0, 3.0 ], 'float16' ); + t.strictEqual( isSameFloat16Array( x, x ), true, 'returns expected value' ); + + x = typedarray( [ 1.0, 2.0, 3.0 ], 'float16' ); + y = typedarray( [ 1.0, 2.0, 3.0 ], 'float16' ); + t.strictEqual( isSameFloat16Array( x, y ), true, 'returns expected value' ); + + x = typedarray( [ -0.0, 0.0, -0.0 ], 'float16' ); + y = typedarray( [ -0.0, 0.0, -0.0 ], 'float16' ); + t.strictEqual( isSameFloat16Array( x, y ), true, 'returns expected value' ); + + x = typedarray( [ NaN, NaN, NaN ], 'float16' ); + y = typedarray( [ NaN, NaN, NaN ], 'float16' ); + t.strictEqual( isSameFloat16Array( x, y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `false` if not provided two Float16Arrays having the same values', function test( t ) { + var x; + var y; + var i; + + x = [ + '', + 'beep', + 5, + 3.14, + -3.14, + 0.0, + -0.0, + true, + false, + null, + void 0, + [], + {}, + function noop() {}, + typedarray( 10, 'float64' ), + typedarray( 10, 'int32' ), + typedarray( 10, 'float64' ), + typedarray( [ 1.0, 2.0, 3.0 ], 'float16' ), + typedarray( [ -0.0, -0.0, -0.0 ], 'float16' ) + ]; + y = [ + 'abc', + 'boop', + -5, + -3.14, + 3.14, + -0.0, + 0.0, + false, + true, + void 0, + null, + [], + {}, + function noop() {}, + typedarray( 10, 'float64' ), + typedarray( 10, 'int32' ), + typedarray( 10, 'float16' ), + typedarray( [ 2.0, 4.0, 6.0 ], 'float16' ), + typedarray( [ 0.0, 0.0, 0.0 ], 'float16' ) + ]; + for ( i = 0; i < x.length; i++ ) { + t.strictEqual( isSameFloat16Array( x[ i ], y[ i ] ), false, 'returns expected value when provided '+x[ i ]+' and '+y[ i ] ); + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/assert/lib/index.js b/lib/node_modules/@stdlib/assert/lib/index.js index 198e1adad3ef..71b2ad6b18a8 100644 --- a/lib/node_modules/@stdlib/assert/lib/index.js +++ b/lib/node_modules/@stdlib/assert/lib/index.js @@ -2616,6 +2616,15 @@ setReadOnly( ns, 'isSameComplex128', require( '@stdlib/assert/is-same-complex128 */ setReadOnly( ns, 'isSameComplex128Array', require( '@stdlib/assert/is-same-complex128array' ) ); +/** +* @name isSameFloat16Array +* @memberof ns +* @readonly +* @type {Function} +* @see {@link module:@stdlib/assert/is-same-float16array} +*/ +setReadOnly( ns, 'isSameFloat16Array', require( '@stdlib/assert/is-same-float16array' ) ); + /** * @name isSameFloat32Array * @memberof ns From 8edc1a54fa5e5c91fcfd12b1e5460b8ad14a28dc Mon Sep 17 00:00:00 2001 From: Samarth Kolarkar Date: Fri, 28 Aug 2026 14:15:03 +0530 Subject: [PATCH 2/5] fix(assert): fix JSDoc formatting and markdown section comment in is-same-float16array --- lib/node_modules/@stdlib/assert/docs/types/index.d.ts | 2 +- lib/node_modules/@stdlib/assert/is-same-float16array/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/docs/types/index.d.ts index fc5d52aef99e..c6cf4f6588a3 100644 --- a/lib/node_modules/@stdlib/assert/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/docs/types/index.d.ts @@ -7037,7 +7037,7 @@ interface Namespace { * * var out = ns.isSameFloat16Array( x, y ); * // returns false - * */ + */ isSameFloat16Array: typeof isSameFloat16Array; /** diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/README.md b/lib/node_modules/@stdlib/assert/is-same-float16array/README.md index eb43d1d6fde8..b7dcdc42dcf9 100644 --- a/lib/node_modules/@stdlib/assert/is-same-float16array/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/README.md @@ -104,7 +104,7 @@ out = isSameFloat16Array( x, y ); - + From 10dccf63a22b302468336d86584d1023be3131ff Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 28 Aug 2026 15:34:14 -0700 Subject: [PATCH 3/5] Discard changes to lib/node_modules/@stdlib/assert/docs/types/index.d.ts --- .../@stdlib/assert/docs/types/index.d.ts | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/docs/types/index.d.ts b/lib/node_modules/@stdlib/assert/docs/types/index.d.ts index c6cf4f6588a3..a6f2f2b021aa 100644 --- a/lib/node_modules/@stdlib/assert/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/assert/docs/types/index.d.ts @@ -306,7 +306,6 @@ import isSameComplex64 = require( '@stdlib/assert/is-same-complex64' ); import isSameComplex64Array = require( '@stdlib/assert/is-same-complex64array' ); import isSameComplex128 = require( '@stdlib/assert/is-same-complex128' ); import isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' ); -import isSameFloat16Array = require( '@stdlib/assert/is-same-float16array' ); import isSameFloat32Array = require( '@stdlib/assert/is-same-float32array' ); import isSameFloat64Array = require( '@stdlib/assert/is-same-float64array' ); import isSameNativeClass = require( '@stdlib/assert/is-same-native-class' ); @@ -7009,37 +7008,6 @@ interface Namespace { */ isSameComplex128Array: typeof isSameComplex128Array; - /** - * Tests if two arguments are both Float16Arrays and have the same values. - * - * ## Notes - * - * - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same. - * - * @param v1 - first input value - * @param v2 - second input value - * @returns boolean indicating whether two arguments are the same - * - * @example - * var Float16Array = require( '@stdlib/array/float16' ); - * - * var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); - * var y = new Float16Array( [ 1.0, 2.0, 3.0 ] ); - * - * var out = ns.isSameFloat16Array( x, y ); - * // returns true - * - * @example - * var Float16Array = require( '@stdlib/array/float16' ); - * - * var x = new Float16Array( [ 1.0, 2.0, 3.0 ] ); - * var y = new Float16Array( [ 1.0, 2.0, 4.0 ] ); - * - * var out = ns.isSameFloat16Array( x, y ); - * // returns false - */ - isSameFloat16Array: typeof isSameFloat16Array; - /** * Tests if two arguments are both Float32Arrays and have the same values. * From 626a3efb4367a400728c1bb266bf5491b122c752 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 28 Aug 2026 15:34:25 -0700 Subject: [PATCH 4/5] Discard changes to lib/node_modules/@stdlib/assert/lib/index.js --- lib/node_modules/@stdlib/assert/lib/index.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/lib/index.js b/lib/node_modules/@stdlib/assert/lib/index.js index 71b2ad6b18a8..198e1adad3ef 100644 --- a/lib/node_modules/@stdlib/assert/lib/index.js +++ b/lib/node_modules/@stdlib/assert/lib/index.js @@ -2616,15 +2616,6 @@ setReadOnly( ns, 'isSameComplex128', require( '@stdlib/assert/is-same-complex128 */ setReadOnly( ns, 'isSameComplex128Array', require( '@stdlib/assert/is-same-complex128array' ) ); -/** -* @name isSameFloat16Array -* @memberof ns -* @readonly -* @type {Function} -* @see {@link module:@stdlib/assert/is-same-float16array} -*/ -setReadOnly( ns, 'isSameFloat16Array', require( '@stdlib/assert/is-same-float16array' ) ); - /** * @name isSameFloat32Array * @memberof ns From 7348e293f70647c7bb88dd5d5cc9b927f79c5d5d Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 28 Aug 2026 15:35:53 -0700 Subject: [PATCH 5/5] Apply batched suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- .../assert/is-same-float16array/README.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/is-same-float16array/README.md b/lib/node_modules/@stdlib/assert/is-same-float16array/README.md index b7dcdc42dcf9..60719f9ab094 100644 --- a/lib/node_modules/@stdlib/assert/is-same-float16array/README.md +++ b/lib/node_modules/@stdlib/assert/is-same-float16array/README.md @@ -94,14 +94,6 @@ out = isSameFloat16Array( x, y ); @@ -114,14 +106,6 @@ out = isSameFloat16Array( x, y ); [@stdlib/assert/is-same-value]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-same-value - - -[@stdlib/assert/is-same-float32array]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-same-float32array - -[@stdlib/assert/is-same-float64array]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/assert/is-same-float64array - - -