@stdlib/complex-float32-base-assert-is-same-value-zero 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.md +15 -15
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +3 -3
- package/docs/types/index.d.ts +6 -4
- package/lib/index.js +2 -2
- package/lib/main.js +3 -3
- package/package.json +4 -4
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ limitations under the License.
|
|
|
29
29
|
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
|
|
30
30
|
</details>
|
|
31
31
|
|
|
32
|
-
#
|
|
32
|
+
# isSameValueZero
|
|
33
33
|
|
|
34
34
|
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
35
35
|
|
|
@@ -60,10 +60,10 @@ npm install @stdlib/complex-float32-base-assert-is-same-value-zero
|
|
|
60
60
|
## Usage
|
|
61
61
|
|
|
62
62
|
```javascript
|
|
63
|
-
var
|
|
63
|
+
var isSameValueZero = require( '@stdlib/complex-float32-base-assert-is-same-value-zero' );
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
####
|
|
66
|
+
#### isSameValueZero( z1, z2 )
|
|
67
67
|
|
|
68
68
|
Tests whether two single-precision complex floating-point numbers are the same value.
|
|
69
69
|
|
|
@@ -73,7 +73,7 @@ var Complex64 = require( '@stdlib/complex-float32-ctor' );
|
|
|
73
73
|
var z1 = new Complex64( 5.0, 3.0 );
|
|
74
74
|
var z2 = new Complex64( 5.0, 3.0 );
|
|
75
75
|
|
|
76
|
-
var out =
|
|
76
|
+
var out = isSameValueZero( z1, z2 );
|
|
77
77
|
// returns true
|
|
78
78
|
```
|
|
79
79
|
|
|
@@ -85,7 +85,7 @@ var Complex64 = require( '@stdlib/complex-float32-ctor' );
|
|
|
85
85
|
var z1 = new Complex64( NaN, NaN );
|
|
86
86
|
var z2 = new Complex64( NaN, NaN );
|
|
87
87
|
|
|
88
|
-
var out =
|
|
88
|
+
var out = isSameValueZero( z1, z2 );
|
|
89
89
|
// returns true
|
|
90
90
|
```
|
|
91
91
|
|
|
@@ -97,7 +97,7 @@ var Complex64 = require( '@stdlib/complex-float32-ctor' );
|
|
|
97
97
|
var z1 = new Complex64( -0.0, 0.0 );
|
|
98
98
|
var z2 = new Complex64( 0.0, -0.0 );
|
|
99
99
|
|
|
100
|
-
var out =
|
|
100
|
+
var out = isSameValueZero( z1, z2 );
|
|
101
101
|
// returns true
|
|
102
102
|
```
|
|
103
103
|
|
|
@@ -123,21 +123,21 @@ var out = isSameValueZerof( z1, z2 );
|
|
|
123
123
|
|
|
124
124
|
```javascript
|
|
125
125
|
var Complex64 = require( '@stdlib/complex-float32-ctor' );
|
|
126
|
-
var
|
|
126
|
+
var isSameValueZero = require( '@stdlib/complex-float32-base-assert-is-same-value-zero' );
|
|
127
127
|
|
|
128
128
|
var z1 = new Complex64( 5.0, 3.0 );
|
|
129
129
|
var z2 = new Complex64( 5.0, 3.0 );
|
|
130
|
-
var out =
|
|
130
|
+
var out = isSameValueZero( z1, z2 );
|
|
131
131
|
// returns true
|
|
132
132
|
|
|
133
133
|
z1 = new Complex64( -5.0, -3.0 );
|
|
134
134
|
z2 = new Complex64( 5.0, 3.0 );
|
|
135
|
-
out =
|
|
135
|
+
out = isSameValueZero( z1, z2 );
|
|
136
136
|
// returns false
|
|
137
137
|
|
|
138
138
|
z1 = new Complex64( NaN, 3.0 );
|
|
139
139
|
z2 = new Complex64( NaN, 3.0 );
|
|
140
|
-
out =
|
|
140
|
+
out = isSameValueZero( z1, z2 );
|
|
141
141
|
// returns true
|
|
142
142
|
```
|
|
143
143
|
|
|
@@ -285,7 +285,7 @@ See [LICENSE][stdlib-license].
|
|
|
285
285
|
|
|
286
286
|
## Copyright
|
|
287
287
|
|
|
288
|
-
Copyright © 2016-
|
|
288
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
289
289
|
|
|
290
290
|
</section>
|
|
291
291
|
|
|
@@ -298,8 +298,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
298
298
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/complex-float32-base-assert-is-same-value-zero.svg
|
|
299
299
|
[npm-url]: https://npmjs.org/package/@stdlib/complex-float32-base-assert-is-same-value-zero
|
|
300
300
|
|
|
301
|
-
[test-image]: https://github.com/stdlib-js/complex-float32-base-assert-is-same-value-zero/actions/workflows/test.yml/badge.svg?branch=v0.1.
|
|
302
|
-
[test-url]: https://github.com/stdlib-js/complex-float32-base-assert-is-same-value-zero/actions/workflows/test.yml?query=branch:v0.1.
|
|
301
|
+
[test-image]: https://github.com/stdlib-js/complex-float32-base-assert-is-same-value-zero/actions/workflows/test.yml/badge.svg?branch=v0.1.1
|
|
302
|
+
[test-url]: https://github.com/stdlib-js/complex-float32-base-assert-is-same-value-zero/actions/workflows/test.yml?query=branch:v0.1.1
|
|
303
303
|
|
|
304
304
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/complex-float32-base-assert-is-same-value-zero/main.svg
|
|
305
305
|
[coverage-url]: https://codecov.io/github/stdlib-js/complex-float32-base-assert-is-same-value-zero?branch=main
|
|
@@ -311,8 +311,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
311
311
|
|
|
312
312
|
-->
|
|
313
313
|
|
|
314
|
-
[chat-image]: https://img.shields.io/
|
|
315
|
-
[chat-url]: https://
|
|
314
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
315
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
316
316
|
|
|
317
317
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
318
318
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference path="../docs/types/index.d.ts" />
|
|
2
|
-
import
|
|
3
|
-
export =
|
|
2
|
+
import isSameValueZero from '../docs/types/index';
|
|
3
|
+
export = isSameValueZero;
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../lib/main.js", "../lib/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isSame = require( '@stdlib/number-float32-base-assert-is-same-value-zero' );\nvar reimf = require( '@stdlib/complex-float32-reim' );\n\n\n// MAIN //\n\n/**\n* Tests whether two single-precision complex floating-point numbers are the same value.\n*\n* ## Notes\n*\n* - The function implements the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016.\n* - In contrast to the strict equality operator `===`, `NaNs` are considered the same value.\n*\n* @param {Complex64} z1 - first complex number\n* @param {Complex64} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n*\n* var z1 = new Complex64( 5.0, 3.0 );\n* var z2 = new Complex64( 5.0, 3.0 );\n*\n* var v =
|
|
5
|
-
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAS,QAAS,uDAAwD,EAC1EC,EAAQ,QAAS,8BAA+B,EA0BpD,SAASC,
|
|
6
|
-
"names": ["require_main", "__commonJSMin", "exports", "module", "isSame", "reimf", "
|
|
4
|
+
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isSame = require( '@stdlib/number-float32-base-assert-is-same-value-zero' );\nvar reimf = require( '@stdlib/complex-float32-reim' );\n\n\n// MAIN //\n\n/**\n* Tests whether two single-precision complex floating-point numbers are the same value.\n*\n* ## Notes\n*\n* - The function implements the SameValueZero Algorithm used by `TypedArray` and `ArrayBuffer` constructors, `Map` and `Set` operations, `String.prototype.includes`, and `Array.prototype.includes` since ES2016.\n* - In contrast to the strict equality operator `===`, `NaNs` are considered the same value.\n*\n* @param {Complex64} z1 - first complex number\n* @param {Complex64} z2 - second complex number\n* @returns {boolean} result\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n*\n* var z1 = new Complex64( 5.0, 3.0 );\n* var z2 = new Complex64( 5.0, 3.0 );\n*\n* var v = isSameValueZero( z1, z2 );\n* // returns true\n*/\nfunction isSameValueZero( z1, z2 ) {\n\tvar parts1 = reimf( z1 );\n\tvar parts2 = reimf( z2 );\n\treturn (\n\t\tisSame( parts1[ 0 ], parts2[ 0 ] ) &&\n\t\tisSame( parts1[ 1 ], parts2[ 1 ] )\n\t);\n}\n\n\n// EXPORTS //\n\nmodule.exports = isSameValueZero;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether two single-precision complex floating-point numbers are the same value.\n*\n* @module @stdlib/complex-float32-base-assert-is-same-value-zero\n*\n* @example\n* var Complex64 = require( '@stdlib/complex-float32-ctor' );\n* var isSameValueZero = require( '@stdlib/complex-float32-base-assert-is-same-value-zero' );\n*\n* var z1 = new Complex64( 5.0, 3.0 );\n* var z2 = new Complex64( 5.0, 3.0 );\n*\n* var v = isSameValueZero( z1, z2 );\n* // returns true\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAS,QAAS,uDAAwD,EAC1EC,EAAQ,QAAS,8BAA+B,EA0BpD,SAASC,EAAiBC,EAAIC,EAAK,CAClC,IAAIC,EAASJ,EAAOE,CAAG,EACnBG,EAASL,EAAOG,CAAG,EACvB,OACCJ,EAAQK,EAAQ,CAAE,EAAGC,EAAQ,CAAE,CAAE,GACjCN,EAAQK,EAAQ,CAAE,EAAGC,EAAQ,CAAE,CAAE,CAEnC,CAKAP,EAAO,QAAUG,ICvBjB,IAAIK,EAAO,IAKX,OAAO,QAAUA",
|
|
6
|
+
"names": ["require_main", "__commonJSMin", "exports", "module", "isSame", "reimf", "isSameValueZero", "z1", "z2", "parts1", "parts2", "main"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
// TypeScript Version: 4.1
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
/// <reference types="@stdlib/types"/>
|
|
22
|
+
|
|
23
|
+
import { Complex64 } from '@stdlib/types/complex';
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Tests whether two single-precision complex floating-point numbers are the same value.
|
|
@@ -37,12 +39,12 @@ import Complex64 = require( '@stdlib/complex-float32-ctor' );
|
|
|
37
39
|
* var z1 = new Complex64( 5.0, 3.0 );
|
|
38
40
|
* var z2 = new Complex64( 5.0, 3.0 );
|
|
39
41
|
*
|
|
40
|
-
* var v =
|
|
42
|
+
* var v = isSameValueZero( z1, z2 );
|
|
41
43
|
* // returns true
|
|
42
44
|
*/
|
|
43
|
-
declare function
|
|
45
|
+
declare function isSameValueZero( z1: Complex64, z2: Complex64 ): boolean;
|
|
44
46
|
|
|
45
47
|
|
|
46
48
|
// EXPORTS //
|
|
47
49
|
|
|
48
|
-
export =
|
|
50
|
+
export = isSameValueZero;
|
package/lib/index.js
CHANGED
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* var Complex64 = require( '@stdlib/complex-float32-ctor' );
|
|
28
|
-
* var
|
|
28
|
+
* var isSameValueZero = require( '@stdlib/complex-float32-base-assert-is-same-value-zero' );
|
|
29
29
|
*
|
|
30
30
|
* var z1 = new Complex64( 5.0, 3.0 );
|
|
31
31
|
* var z2 = new Complex64( 5.0, 3.0 );
|
|
32
32
|
*
|
|
33
|
-
* var v =
|
|
33
|
+
* var v = isSameValueZero( z1, z2 );
|
|
34
34
|
* // returns true
|
|
35
35
|
*/
|
|
36
36
|
|
package/lib/main.js
CHANGED
|
@@ -44,10 +44,10 @@ var reimf = require( '@stdlib/complex-float32-reim' );
|
|
|
44
44
|
* var z1 = new Complex64( 5.0, 3.0 );
|
|
45
45
|
* var z2 = new Complex64( 5.0, 3.0 );
|
|
46
46
|
*
|
|
47
|
-
* var v =
|
|
47
|
+
* var v = isSameValueZero( z1, z2 );
|
|
48
48
|
* // returns true
|
|
49
49
|
*/
|
|
50
|
-
function
|
|
50
|
+
function isSameValueZero( z1, z2 ) {
|
|
51
51
|
var parts1 = reimf( z1 );
|
|
52
52
|
var parts2 = reimf( z2 );
|
|
53
53
|
return (
|
|
@@ -59,4 +59,4 @@ function isSameValueZerof( z1, z2 ) {
|
|
|
59
59
|
|
|
60
60
|
// EXPORTS //
|
|
61
61
|
|
|
62
|
-
module.exports =
|
|
62
|
+
module.exports = isSameValueZero;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/complex-float32-base-assert-is-same-value-zero",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Test whether two single-precision complex floating-point numbers are the same value.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@stdlib/complex-float32-ctor": "^0.0
|
|
36
|
-
"@stdlib/complex-float32-reim": "
|
|
37
|
-
"@stdlib/number-float32-base-assert-is-same-value-zero": "^0.
|
|
35
|
+
"@stdlib/complex-float32-ctor": "^0.1.0",
|
|
36
|
+
"@stdlib/complex-float32-reim": "^0.1.2",
|
|
37
|
+
"@stdlib/number-float32-base-assert-is-same-value-zero": "^0.2.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {},
|
|
40
40
|
"engines": {
|