@stdlib/complex-float32-base-assert 0.1.0 → 0.2.0
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 +11 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/docs/types/index.d.ts +57 -0
- package/lib/index.js +18 -0
- package/package.json +7 -5
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -68,6 +68,8 @@ The namespace contains the following functions:
|
|
|
68
68
|
|
|
69
69
|
<div class="namespace-toc">
|
|
70
70
|
|
|
71
|
+
- <span class="signature">[`isAlmostEqual( z1, z2, maxULP )`][@stdlib/complex/float32/base/assert/is-almost-equal]</span><span class="delimiter">: </span><span class="description">test whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place).</span>
|
|
72
|
+
- <span class="signature">[`isAlmostSameValue( z1, z2, maxULP )`][@stdlib/complex/float32/base/assert/is-almost-same-value]</span><span class="delimiter">: </span><span class="description">test whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place).</span>
|
|
71
73
|
- <span class="signature">[`isEqual( z1, z2 )`][@stdlib/complex/float32/base/assert/is-equal]</span><span class="delimiter">: </span><span class="description">test whether two single-precision complex floating-point numbers are equal.</span>
|
|
72
74
|
- <span class="signature">[`isNotEqual( z1, z2 )`][@stdlib/complex/float32/base/assert/is-not-equal]</span><span class="delimiter">: </span><span class="description">test whether two single-precision complex floating-point numbers are not equal.</span>
|
|
73
75
|
- <span class="signature">[`isSameValueZero( z1, z2 )`][@stdlib/complex/float32/base/assert/is-same-value-zero]</span><span class="delimiter">: </span><span class="description">test whether two single-precision complex floating-point numbers are the same value.</span>
|
|
@@ -142,7 +144,7 @@ See [LICENSE][stdlib-license].
|
|
|
142
144
|
|
|
143
145
|
## Copyright
|
|
144
146
|
|
|
145
|
-
Copyright © 2016-
|
|
147
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
146
148
|
|
|
147
149
|
</section>
|
|
148
150
|
|
|
@@ -155,8 +157,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
155
157
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/complex-float32-base-assert.svg
|
|
156
158
|
[npm-url]: https://npmjs.org/package/@stdlib/complex-float32-base-assert
|
|
157
159
|
|
|
158
|
-
[test-image]: https://github.com/stdlib-js/complex-float32-base-assert/actions/workflows/test.yml/badge.svg?branch=v0.
|
|
159
|
-
[test-url]: https://github.com/stdlib-js/complex-float32-base-assert/actions/workflows/test.yml?query=branch:v0.
|
|
160
|
+
[test-image]: https://github.com/stdlib-js/complex-float32-base-assert/actions/workflows/test.yml/badge.svg?branch=v0.2.0
|
|
161
|
+
[test-url]: https://github.com/stdlib-js/complex-float32-base-assert/actions/workflows/test.yml?query=branch:v0.2.0
|
|
160
162
|
|
|
161
163
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/complex-float32-base-assert/main.svg
|
|
162
164
|
[coverage-url]: https://codecov.io/github/stdlib-js/complex-float32-base-assert?branch=main
|
|
@@ -168,8 +170,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
168
170
|
|
|
169
171
|
-->
|
|
170
172
|
|
|
171
|
-
[chat-image]: https://img.shields.io/
|
|
172
|
-
[chat-url]: https://
|
|
173
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
174
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
173
175
|
|
|
174
176
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
175
177
|
|
|
@@ -190,6 +192,10 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
190
192
|
|
|
191
193
|
<!-- <toc-links> -->
|
|
192
194
|
|
|
195
|
+
[@stdlib/complex/float32/base/assert/is-almost-equal]: https://www.npmjs.com/package/@stdlib/complex-float32-base-assert-is-almost-equal
|
|
196
|
+
|
|
197
|
+
[@stdlib/complex/float32/base/assert/is-almost-same-value]: https://www.npmjs.com/package/@stdlib/complex-float32-base-assert-is-almost-same-value
|
|
198
|
+
|
|
193
199
|
[@stdlib/complex/float32/base/assert/is-equal]: https://www.npmjs.com/package/@stdlib/complex-float32-base-assert-is-equal
|
|
194
200
|
|
|
195
201
|
[@stdlib/complex/float32/base/assert/is-not-equal]: https://www.npmjs.com/package/@stdlib/complex-float32-base-assert-is-not-equal
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var r=require('@stdlib/utils-define-read-only-property/dist'),e={};r(e,"isEqual",require('@stdlib/complex-float32-base-assert-is-equal/dist'));r(e,"isNotEqual",require('@stdlib/complex-float32-base-assert-is-not-equal/dist'));r(e,"isSameValue",require('@stdlib/complex-float32-base-assert-is-same-value/dist'));r(e,"isSameValueZero",require('@stdlib/complex-float32-base-assert-is-same-value-zero/dist'));module.exports=e;
|
|
1
|
+
"use strict";var r=require('@stdlib/utils-define-read-only-property/dist'),e={};r(e,"isAlmostEqual",require('@stdlib/complex-float32-base-assert-is-almost-equal/dist'));r(e,"isAlmostSameValue",require('@stdlib/complex-float32-base-assert-is-almost-same-value/dist'));r(e,"isEqual",require('@stdlib/complex-float32-base-assert-is-equal/dist'));r(e,"isNotEqual",require('@stdlib/complex-float32-base-assert-is-not-equal/dist'));r(e,"isSameValue",require('@stdlib/complex-float32-base-assert-is-same-value/dist'));r(e,"isSameValueZero",require('@stdlib/complex-float32-base-assert-is-same-value-zero/dist'));module.exports=e;
|
|
2
2
|
/** @license Apache-2.0 */
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../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/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name isEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-equal}\n*/\nsetReadOnly( ns, 'isEqual', require( '@stdlib/complex-float32-base-assert-is-equal' ) );\n\n/**\n* @name isNotEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-not-equal}\n*/\nsetReadOnly( ns, 'isNotEqual', require( '@stdlib/complex-float32-base-assert-is-not-equal' ) );\n\n/**\n* @name isSameValue\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-same-value}\n*/\nsetReadOnly( ns, 'isSameValue', require( '@stdlib/complex-float32-base-assert-is-same-value' ) );\n\n/**\n* @name isSameValueZero\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-same-value-zero}\n*/\nsetReadOnly( ns, 'isSameValueZero', require( '@stdlib/complex-float32-base-assert-is-same-value-zero' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"],
|
|
5
|
-
"mappings": "aA0BA,IAAIA,EAAc,QAAS,yCAA0C,EAUjEC,EAAK,CAAC,EASVD,EAAaC,EAAI,UAAW,QAAS,8CAA+C,CAAE,EAStFD,EAAaC,EAAI,aAAc,QAAS,kDAAmD,CAAE,EAS7FD,EAAaC,EAAI,cAAe,QAAS,mDAAoD,CAAE,EAS/FD,EAAaC,EAAI,kBAAmB,QAAS,wDAAyD,CAAE,EAKxG,OAAO,QAAUA",
|
|
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/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name isAlmostEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-almost-equal}\n*/\nsetReadOnly( ns, 'isAlmostEqual', require( '@stdlib/complex-float32-base-assert-is-almost-equal' ) );\n\n/**\n* @name isAlmostSameValue\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-almost-same-value}\n*/\nsetReadOnly( ns, 'isAlmostSameValue', require( '@stdlib/complex-float32-base-assert-is-almost-same-value' ) );\n\n/**\n* @name isEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-equal}\n*/\nsetReadOnly( ns, 'isEqual', require( '@stdlib/complex-float32-base-assert-is-equal' ) );\n\n/**\n* @name isNotEqual\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-not-equal}\n*/\nsetReadOnly( ns, 'isNotEqual', require( '@stdlib/complex-float32-base-assert-is-not-equal' ) );\n\n/**\n* @name isSameValue\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-same-value}\n*/\nsetReadOnly( ns, 'isSameValue', require( '@stdlib/complex-float32-base-assert-is-same-value' ) );\n\n/**\n* @name isSameValueZero\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/complex/float32/base/assert/is-same-value-zero}\n*/\nsetReadOnly( ns, 'isSameValueZero', require( '@stdlib/complex-float32-base-assert-is-same-value-zero' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"],
|
|
5
|
+
"mappings": "aA0BA,IAAIA,EAAc,QAAS,yCAA0C,EAUjEC,EAAK,CAAC,EASVD,EAAaC,EAAI,gBAAiB,QAAS,qDAAsD,CAAE,EASnGD,EAAaC,EAAI,oBAAqB,QAAS,0DAA2D,CAAE,EAS5GD,EAAaC,EAAI,UAAW,QAAS,8CAA+C,CAAE,EAStFD,EAAaC,EAAI,aAAc,QAAS,kDAAmD,CAAE,EAS7FD,EAAaC,EAAI,cAAe,QAAS,mDAAoD,CAAE,EAS/FD,EAAaC,EAAI,kBAAmB,QAAS,wDAAyD,CAAE,EAKxG,OAAO,QAAUA",
|
|
6
6
|
"names": ["setReadOnly", "ns"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
/* eslint-disable max-lines */
|
|
22
22
|
|
|
23
|
+
import isAlmostEqual = require( '@stdlib/complex-float32-base-assert-is-almost-equal' );
|
|
24
|
+
import isAlmostSameValue = require( '@stdlib/complex-float32-base-assert-is-almost-same-value' );
|
|
23
25
|
import isEqual = require( '@stdlib/complex-float32-base-assert-is-equal' );
|
|
24
26
|
import isNotEqual = require( '@stdlib/complex-float32-base-assert-is-not-equal' );
|
|
25
27
|
import isSameValue = require( '@stdlib/complex-float32-base-assert-is-same-value' );
|
|
@@ -29,6 +31,61 @@ import isSameValueZero = require( '@stdlib/complex-float32-base-assert-is-same-v
|
|
|
29
31
|
* Interface describing the `assert` namespace.
|
|
30
32
|
*/
|
|
31
33
|
interface Namespace {
|
|
34
|
+
/**
|
|
35
|
+
* Tests whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place).
|
|
36
|
+
*
|
|
37
|
+
* ## Notes
|
|
38
|
+
*
|
|
39
|
+
* - The function returns `false` if either input value has a `NaN` real or imaginary component.
|
|
40
|
+
* - The function does not distinguish between `-0` and `+0`, treating them as equal.
|
|
41
|
+
*
|
|
42
|
+
* @param z1 - first complex number
|
|
43
|
+
* @param z2 - second complex number
|
|
44
|
+
* @param maxULP - maximum allowed ULP difference
|
|
45
|
+
* @returns boolean indicating whether two single-precision complex floating-point numbers are approximately equal within a specified number of ULPs
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* var EPS = require( '@stdlib/constants-float32-eps' );
|
|
49
|
+
* var Complex64 = require( '@stdlib/complex-float32-ctor' );
|
|
50
|
+
*
|
|
51
|
+
* var z1 = new Complex64( 1.0, 3.0 );
|
|
52
|
+
* var z2 = new Complex64( 1.0+EPS, 3.0 );
|
|
53
|
+
*
|
|
54
|
+
* var bool = ns.isAlmostEqual( z1, z2, 0 );
|
|
55
|
+
* // returns false
|
|
56
|
+
*
|
|
57
|
+
* bool = ns.isAlmostEqual( z1, z2, 1 );
|
|
58
|
+
* // returns true
|
|
59
|
+
*/
|
|
60
|
+
isAlmostEqual: typeof isAlmostEqual;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Tests whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs (units in the last place).
|
|
64
|
+
*
|
|
65
|
+
* ## Notes
|
|
66
|
+
*
|
|
67
|
+
* - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same.
|
|
68
|
+
*
|
|
69
|
+
* @param z1 - first complex number
|
|
70
|
+
* @param z2 - second complex number
|
|
71
|
+
* @param maxULP - maximum allowed ULP difference
|
|
72
|
+
* @returns boolean indicating whether two single-precision complex floating-point numbers are approximately the same value within a specified number of ULPs
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* var EPS = require( '@stdlib/constants-float32-eps' );
|
|
76
|
+
* var Complex64 = require( '@stdlib/complex-float32-ctor' );
|
|
77
|
+
*
|
|
78
|
+
* var z1 = new Complex64( 1.0, 3.0 );
|
|
79
|
+
* var z2 = new Complex64( 1.0+EPS, 3.0 );
|
|
80
|
+
*
|
|
81
|
+
* var bool = ns.isAlmostSameValue( z1, z2, 0 );
|
|
82
|
+
* // returns false
|
|
83
|
+
*
|
|
84
|
+
* bool = ns.isAlmostSameValue( z1, z2, 1 );
|
|
85
|
+
* // returns true
|
|
86
|
+
*/
|
|
87
|
+
isAlmostSameValue: typeof isAlmostSameValue;
|
|
88
|
+
|
|
32
89
|
/**
|
|
33
90
|
* Tests whether two single-precision complex floating-point numbers are equal.
|
|
34
91
|
*
|
package/lib/index.js
CHANGED
|
@@ -36,6 +36,24 @@ var setReadOnly = require( '@stdlib/utils-define-read-only-property' );
|
|
|
36
36
|
*/
|
|
37
37
|
var ns = {};
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* @name isAlmostEqual
|
|
41
|
+
* @memberof ns
|
|
42
|
+
* @readonly
|
|
43
|
+
* @type {Function}
|
|
44
|
+
* @see {@link module:@stdlib/complex/float32/base/assert/is-almost-equal}
|
|
45
|
+
*/
|
|
46
|
+
setReadOnly( ns, 'isAlmostEqual', require( '@stdlib/complex-float32-base-assert-is-almost-equal' ) );
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @name isAlmostSameValue
|
|
50
|
+
* @memberof ns
|
|
51
|
+
* @readonly
|
|
52
|
+
* @type {Function}
|
|
53
|
+
* @see {@link module:@stdlib/complex/float32/base/assert/is-almost-same-value}
|
|
54
|
+
*/
|
|
55
|
+
setReadOnly( ns, 'isAlmostSameValue', require( '@stdlib/complex-float32-base-assert-is-almost-same-value' ) );
|
|
56
|
+
|
|
39
57
|
/**
|
|
40
58
|
* @name isEqual
|
|
41
59
|
* @memberof ns
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/complex-float32-base-assert",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Base (i.e., lower-level) single-precision complex number assertion functions.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@stdlib/complex-float32-base-assert-is-equal": "
|
|
34
|
-
"@stdlib/complex-float32-base-assert-is-
|
|
35
|
-
"@stdlib/complex-float32-base-assert-is-
|
|
36
|
-
"@stdlib/complex-float32-base-assert-is-
|
|
33
|
+
"@stdlib/complex-float32-base-assert-is-almost-equal": "github:stdlib-js/complex-float32-base-assert-is-almost-equal#main",
|
|
34
|
+
"@stdlib/complex-float32-base-assert-is-almost-same-value": "github:stdlib-js/complex-float32-base-assert-is-almost-same-value#main",
|
|
35
|
+
"@stdlib/complex-float32-base-assert-is-equal": "^0.1.2",
|
|
36
|
+
"@stdlib/complex-float32-base-assert-is-not-equal": "^0.1.2",
|
|
37
|
+
"@stdlib/complex-float32-base-assert-is-same-value": "^0.1.2",
|
|
38
|
+
"@stdlib/complex-float32-base-assert-is-same-value-zero": "^0.1.1",
|
|
37
39
|
"@stdlib/utils-define-read-only-property": "^0.2.2"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {},
|