Repository navigation
feat: add assert/is-equal-int64array
#15663
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
Merged
kgryte
merged 33 commits into
stdlib-js:develop
from
DivitJain26:feat/add-is-equal-int64array
Oct 13, 2026
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
40140bb
feat: add strided/base/reinterpret-uint64
DivitJain26 6dd0c59
docs: add package.json
DivitJain26 383a38e
feat: add entry point
DivitJain26 cd5666a
test: adds test
DivitJain26 c2a1b47
bench: adds benchmark
DivitJain26 13c9693
docs: adds type definition
DivitJain26 38c4bac
docs: adds repl file
DivitJain26 596902f
docs: adds example
DivitJain26 683e28e
chore: fix import order
DivitJain26 46707db
chore: upadte exmpales
DivitJain26 5888466
docs: add readme
DivitJain26 a35b9dc
chore: upadte exmpales
DivitJain26 f4b8af1
chore: update example
DivitJain26 dfdaefa
feat: add uint64 support for hasEqualValues
DivitJain26 c0abe5b
test: adds test for hasEqualValues
DivitJain26 5ca3241
Merge branch 'develop' into feat/add-uint64-support-for-has-equal-values
kgryte 92736ca
Apply suggestions from code review
kgryte 122a330
Merge branch 'stdlib-js:develop' into feat/add-uint64-support-for-has…
DivitJain26 9860e9d
feat: add support for comparision of int64 and uin64 array with real …
DivitJain26 f414234
feat: add support for comparision of int64 and uin64 array with real …
DivitJain26 8238eb4
test: add tests
DivitJain26 0e1fc06
refactor: use hexcode value
DivitJain26 cd0b6ca
docs: use hexcode value in example
DivitJain26 f954ce7
test: improve tests
DivitJain26 2dd0b14
Merge branch 'stdlib-js:develop' into feat/add-uint64-support-for-has…
DivitJain26 0c3917a
feat: add arrest/is-equal-int64array
DivitJain26 abe4b76
test: add test
DivitJain26 0d0d7a5
bench: add benchmarks
DivitJain26 2f96e87
docs: add docs
DivitJain26 a0798de
docs: add examples
DivitJain26 77b83fc
docs: add readme
DivitJain26 c37b4f1
Merge remote-tracking branch 'upstream/develop' into feat/add-is-equa…
stdlib-bot 2bd8f8e
docs: add links
kgryte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
lib/node_modules/@stdlib/assert/is-equal-int64array/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| <!-- | ||
|
|
||
| @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. | ||
|
|
||
| --> | ||
|
|
||
| # isEqualInt64Array | ||
|
|
||
| > Test if two arguments are both [Int64Arrays][@stdlib/array/int64] and have equal values. | ||
|
|
||
| <section class="usage"> | ||
|
|
||
| ## Usage | ||
|
|
||
| ```javascript | ||
| var isEqualInt64Array = require( '@stdlib/assert/is-equal-int64array' ); | ||
| ``` | ||
|
|
||
| #### isEqualInt64Array( v1, v2 ) | ||
|
|
||
| Tests if two arguments are both [Int64Arrays][@stdlib/array/int64] and have equal values. | ||
|
|
||
| ```javascript | ||
| var Int64Array = require( '@stdlib/array/int64' ); | ||
|
|
||
| var x = new Int64Array( [ 1, 2 ] ); | ||
| var y = new Int64Array( [ 1, 2 ] ); | ||
| var bool = isEqualInt64Array( x, y ); | ||
| // returns true | ||
|
|
||
| bool = isEqualInt64Array( x, new Int64Array( [ 1, 3 ] ) ); | ||
| // returns false | ||
| ``` | ||
|
|
||
| </section> | ||
|
|
||
| <!-- /.usage --> | ||
|
|
||
| <section class="notes"> | ||
|
|
||
| </section> | ||
|
|
||
| <!-- /.notes --> | ||
|
|
||
| <section class="examples"> | ||
|
|
||
| ## Examples | ||
|
|
||
| <!-- eslint no-undef: "error" --> | ||
|
|
||
| ```javascript | ||
| var Int64Array = require( '@stdlib/array/int64' ); | ||
| var Uint64Array = require( '@stdlib/array/uint64' ); | ||
| var isEqualInt64Array = require( '@stdlib/assert/is-equal-int64array' ); | ||
|
|
||
| var x = new Int64Array( [ 1, 2, 3 ] ); | ||
| var y = new Int64Array( [ 1, 2, 3 ] ); | ||
| var out = isEqualInt64Array( x, y ); | ||
| // returns true | ||
|
|
||
| x = new Int64Array( [ 1, 2, 3 ] ); | ||
| y = new Uint64Array( [ 1, 2, 3 ] ); | ||
| out = isEqualInt64Array( x, y ); | ||
| // returns false | ||
|
|
||
| x = new Int64Array( [ 1, 2, 3 ] ); | ||
| y = new Int64Array( [ 1, 2, 4 ] ); | ||
| out = isEqualInt64Array( x, y ); | ||
| // returns false | ||
| ``` | ||
|
|
||
| </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"> | ||
|
|
||
| [@stdlib/array/int64]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/int64 | ||
|
|
||
| </section> | ||
|
|
||
| <!-- /.links --> |
98 changes: 98 additions & 0 deletions
98
lib/node_modules/@stdlib/assert/is-equal-int64array/benchmark/benchmark.length.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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/zero-to' ); | ||
| var Int64Array = require( '@stdlib/array/int64' ); | ||
| var format = require( '@stdlib/string/format' ); | ||
| var pkg = require( './../package.json' ).name; | ||
| var isEqualInt64Array = require( './../lib' ); | ||
|
|
||
|
|
||
| // FUNCTIONS // | ||
|
|
||
| /** | ||
| * Creates a benchmark function. | ||
| * | ||
| * @private | ||
| * @param {PositiveInteger} len - array length | ||
| * @returns {Function} benchmark function | ||
| */ | ||
| function createBenchmark( len ) { | ||
| var x = new Int64Array( zeroTo( len ) ); | ||
| var y = new Int64Array( 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 = isEqualInt64Array( 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(); | ||
32 changes: 32 additions & 0 deletions
32
lib/node_modules/@stdlib/assert/is-equal-int64array/docs/repl.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
|
|
||
| {{alias}}( v1, v2 ) | ||
| Tests if two arguments are both Int64Arrays and have equal values. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| v1: any | ||
| First input value. | ||
|
|
||
| v2: any | ||
| Second input value. | ||
|
|
||
| Returns | ||
| ------- | ||
| bool: boolean | ||
| Boolean indicating whether two arguments are equal. | ||
|
|
||
| Examples | ||
| -------- | ||
| > var x = new {{alias:@stdlib/array/int64}}( [ 1, 2, 3 ] ); | ||
| > var y = new {{alias:@stdlib/array/int64}}( [ 1, 2, 3 ] ); | ||
| > var bool = {{alias}}( x, y ) | ||
| true | ||
|
|
||
| > x = new {{alias:@stdlib/array/int64}}( [ 1, 2, 3 ] ); | ||
| > y = new {{alias:@stdlib/array/int64}}( [ 1, 2, 4 ] ); | ||
| > bool = {{alias}}( x, y ) | ||
| false | ||
|
|
||
| See Also | ||
| -------- | ||
|
|
51 changes: 51 additions & 0 deletions
51
lib/node_modules/@stdlib/assert/is-equal-int64array/docs/types/index.d.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* | ||
| * @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 Int64Arrays and have equal values. | ||
| * | ||
| * @param v1 - first input value | ||
| * @param v2 - second input value | ||
| * @returns boolean indicating whether two arguments are equal | ||
| * | ||
| * @example | ||
| * var Int64Array = require( '@stdlib/array/int64' ); | ||
| * | ||
| * var x = new Int64Array( [ 1, 2, 3 ] ); | ||
| * var y = new Int64Array( [ 1, 2, 3 ] ); | ||
| * | ||
| * var out = isEqualInt64Array( x, y ); | ||
| * // returns true | ||
| * | ||
| * @example | ||
| * var Int64Array = require( '@stdlib/array/int64' ); | ||
| * | ||
| * var x = new Int64Array( [ 1, 2, 3 ] ); | ||
| * var y = new Int64Array( [ 1, 2, 4 ] ); | ||
| * | ||
| * var out = isEqualInt64Array( x, y ); | ||
| * // returns false | ||
| */ | ||
| declare function isEqualInt64Array( v1: any, v2: any ): boolean; | ||
|
Check warning on line 46 in lib/node_modules/@stdlib/assert/is-equal-int64array/docs/types/index.d.ts
|
||
|
|
||
|
|
||
| // EXPORTS // | ||
|
|
||
| export = isEqualInt64Array; | ||
36 changes: 36 additions & 0 deletions
36
lib/node_modules/@stdlib/assert/is-equal-int64array/docs/types/test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 isEqualInt64Array = require( './index' ); | ||
|
|
||
|
|
||
| // TESTS // | ||
|
|
||
| // The function returns a boolean... | ||
| { | ||
| isEqualInt64Array( 3.14, 3.14 ); // $ExpectType boolean | ||
| isEqualInt64Array( null, null ); // $ExpectType boolean | ||
| isEqualInt64Array( 'beep', 'boop' ); // $ExpectType boolean | ||
| } | ||
|
|
||
| // The compiler throws an error if the function is provided an unsupported number of arguments... | ||
| { | ||
| isEqualInt64Array(); // $ExpectError | ||
| isEqualInt64Array( 3.14 ); // $ExpectError | ||
| isEqualInt64Array( 'beep', 'beep', 3.14 ); // $ExpectError | ||
| } |
41 changes: 41 additions & 0 deletions
41
lib/node_modules/@stdlib/assert/is-equal-int64array/examples/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /** | ||
| * @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 Int64Array = require( '@stdlib/array/int64' ); | ||
| var Uint64Array = require( '@stdlib/array/uint64' ); | ||
| var isEqualInt64Array = require( './../lib' ); | ||
|
|
||
| var x = new Int64Array( [ 1, 2, 3 ] ); | ||
| var y = new Int64Array( [ 1, 2, 3 ] ); | ||
| var out = isEqualInt64Array( x, y ); | ||
| console.log( out ); | ||
| // => true | ||
|
|
||
| x = new Int64Array( [ 1, 2, 3 ] ); | ||
| y = new Uint64Array( [ 1, 2, 3 ] ); | ||
| out = isEqualInt64Array( x, y ); | ||
| console.log( out ); | ||
| // => false | ||
|
|
||
| x = new Int64Array( [ 1, 2, 3 ] ); | ||
| y = new Int64Array( [ 1, 2, 4 ] ); | ||
| out = isEqualInt64Array( x, y ); | ||
| console.log( out ); | ||
| // => false |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a chicken-and-the-egg situation. This is fine for now. We'll want to eventually replace with
zeroTo( len, 'int64' )once we addint64support tozero-to.