@stdlib/number-float64-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/README.md CHANGED
@@ -66,6 +66,13 @@ The namespace contains the following functions:
66
66
 
67
67
  <!-- <toc pattern="*"> -->
68
68
 
69
+ <div class="namespace-toc">
70
+
71
+ - <span class="signature">[`isSameValueZero( a, b )`][@stdlib/number/float64/base/assert/is-same-value-zero]</span><span class="delimiter">: </span><span class="description">test if two double-precision floating-point numbers are the same value.</span>
72
+ - <span class="signature">[`isSameValue( a, b )`][@stdlib/number/float64/base/assert/is-same-value]</span><span class="delimiter">: </span><span class="description">test if two double-precision floating-point numbers are the same value.</span>
73
+
74
+ </div>
75
+
69
76
  <!-- </toc> -->
70
77
 
71
78
  </section>
@@ -146,8 +153,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
146
153
  [npm-image]: http://img.shields.io/npm/v/@stdlib/number-float64-base-assert.svg
147
154
  [npm-url]: https://npmjs.org/package/@stdlib/number-float64-base-assert
148
155
 
149
- [test-image]: https://github.com/stdlib-js/number-float64-base-assert/actions/workflows/test.yml/badge.svg?branch=v0.1.0
150
- [test-url]: https://github.com/stdlib-js/number-float64-base-assert/actions/workflows/test.yml?query=branch:v0.1.0
156
+ [test-image]: https://github.com/stdlib-js/number-float64-base-assert/actions/workflows/test.yml/badge.svg?branch=v0.2.0
157
+ [test-url]: https://github.com/stdlib-js/number-float64-base-assert/actions/workflows/test.yml?query=branch:v0.2.0
151
158
 
152
159
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/number-float64-base-assert/main.svg
153
160
  [coverage-url]: https://codecov.io/github/stdlib-js/number-float64-base-assert?branch=main
@@ -170,14 +177,21 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
170
177
  [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
171
178
 
172
179
  [deno-url]: https://github.com/stdlib-js/number-float64-base-assert/tree/deno
180
+ [deno-readme]: https://github.com/stdlib-js/number-float64-base-assert/blob/deno/README.md
173
181
  [umd-url]: https://github.com/stdlib-js/number-float64-base-assert/tree/umd
182
+ [umd-readme]: https://github.com/stdlib-js/number-float64-base-assert/blob/umd/README.md
174
183
  [esm-url]: https://github.com/stdlib-js/number-float64-base-assert/tree/esm
184
+ [esm-readme]: https://github.com/stdlib-js/number-float64-base-assert/blob/esm/README.md
175
185
  [branches-url]: https://github.com/stdlib-js/number-float64-base-assert/blob/main/branches.md
176
186
 
177
187
  [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/number-float64-base-assert/main/LICENSE
178
188
 
179
189
  <!-- <toc-links> -->
180
190
 
191
+ [@stdlib/number/float64/base/assert/is-same-value-zero]: https://www.npmjs.com/package/@stdlib/number-float64-base-assert-is-same-value-zero
192
+
193
+ [@stdlib/number/float64/base/assert/is-same-value]: https://www.npmjs.com/package/@stdlib/number-float64-base-assert-is-same-value
194
+
181
195
  <!-- </toc-links> -->
182
196
 
183
197
  </section>
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,"isSameValue",require('@stdlib/number-float64-base-assert-is-same-value/dist'));module.exports=e;
1
+ "use strict";var r=require('@stdlib/utils-define-read-only-property/dist'),e={};r(e,"isSameValue",require('@stdlib/number-float64-base-assert-is-same-value/dist'));r(e,"isSameValueZero",require('@stdlib/number-float64-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 isSameValue\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/number/float64/base/assert/is-same-value}\n*/\nsetReadOnly( ns, 'isSameValue', require( '@stdlib/number-float64-base-assert-is-same-value' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"],
5
- "mappings": "aA0BA,IAAIA,EAAc,QAAS,yCAA0C,EAUjEC,EAAK,CAAC,EASVD,EAAaC,EAAI,cAAe,QAAS,kDAAmD,CAAE,EAK9F,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 isSameValue\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/number/float64/base/assert/is-same-value}\n*/\nsetReadOnly( ns, 'isSameValue', require( '@stdlib/number-float64-base-assert-is-same-value' ) );\n\n/**\n* @name isSameValueZero\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/number/float64/base/assert/is-same-value-zero}\n*/\nsetReadOnly( ns, 'isSameValueZero', require( '@stdlib/number-float64-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,cAAe,QAAS,kDAAmD,CAAE,EAS9FD,EAAaC,EAAI,kBAAmB,QAAS,uDAAwD,CAAE,EAKvG,OAAO,QAAUA",
6
6
  "names": ["setReadOnly", "ns"]
7
7
  }
@@ -21,15 +21,69 @@
21
21
  /* eslint-disable max-lines */
22
22
 
23
23
  import isSameValue = require( '@stdlib/number-float64-base-assert-is-same-value' );
24
+ import isSameValueZero = require( '@stdlib/number-float64-base-assert-is-same-value-zero' );
24
25
 
25
26
  /**
26
27
  * Interface describing the `assert` namespace.
27
28
  */
28
29
  interface Namespace {
29
30
  /**
30
- * TODO
31
+ * Tests if two double-precision floating-point numbers are the same value.
32
+ *
33
+ * ## Notes
34
+ *
35
+ * - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same.
36
+ *
37
+ * @param a - first input value
38
+ * @param b - second input value
39
+ * @returns boolean indicating whether two double-precision floating-point numbers are the same value
40
+ *
41
+ * @example
42
+ * var bool = ns.isSameValue( 3.14, 3.14 );
43
+ * // returns true
44
+ *
45
+ * @example
46
+ * var bool = ns.isSameValue( -0.0, -0.0 );
47
+ * // returns true
48
+ *
49
+ * @example
50
+ * var bool = ns.isSameValue( -0.0, 0.0 );
51
+ * // returns false
52
+ *
53
+ * @example
54
+ * var bool = ns.isSameValue( NaN, NaN );
55
+ * // returns true
31
56
  */
32
57
  isSameValue: typeof isSameValue;
58
+
59
+ /**
60
+ * Tests if two double-precision floating-point numbers are the same value.
61
+ *
62
+ * ## Notes
63
+ *
64
+ * - The function differs from the `===` operator in that the function treats ``NaNs` as the same value.
65
+ *
66
+ * @param a - first input value
67
+ * @param b - second input value
68
+ * @returns boolean indicating whether two double-precision floating-point numbers are the same value
69
+ *
70
+ * @example
71
+ * var bool = ns.isSameValueZero( 3.14, 3.14 );
72
+ * // returns true
73
+ *
74
+ * @example
75
+ * var bool = ns.isSameValueZero( -0.0, -0.0 );
76
+ * // returns true
77
+ *
78
+ * @example
79
+ * var bool = ns.isSameValueZero( -0.0, 0.0 );
80
+ * // returns true
81
+ *
82
+ * @example
83
+ * var bool = ns.isSameValueZero( NaN, NaN );
84
+ * // returns true
85
+ */
86
+ isSameValueZero: typeof isSameValueZero;
33
87
  }
34
88
 
35
89
  /**
package/lib/index.js CHANGED
@@ -45,6 +45,15 @@ var ns = {};
45
45
  */
46
46
  setReadOnly( ns, 'isSameValue', require( '@stdlib/number-float64-base-assert-is-same-value' ) );
47
47
 
48
+ /**
49
+ * @name isSameValueZero
50
+ * @memberof ns
51
+ * @readonly
52
+ * @type {Function}
53
+ * @see {@link module:@stdlib/number/float64/base/assert/is-same-value-zero}
54
+ */
55
+ setReadOnly( ns, 'isSameValueZero', require( '@stdlib/number-float64-base-assert-is-same-value-zero' ) );
56
+
48
57
 
49
58
  // EXPORTS //
50
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/number-float64-base-assert",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Base double-precision floating-point number assert functions.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -36,19 +36,20 @@
36
36
  "url": "https://github.com/stdlib-js/stdlib/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@stdlib/number-float64-base-assert-is-same-value": "github:stdlib-js/number-float64-base-assert-is-same-value#main",
40
- "@stdlib/utils-define-read-only-property": "^0.1.1"
39
+ "@stdlib/number-float64-base-assert-is-same-value": "^0.2.0",
40
+ "@stdlib/number-float64-base-assert-is-same-value-zero": "^0.2.0",
41
+ "@stdlib/utils-define-read-only-property": "^0.2.0"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@stdlib/assert-is-boolean": "^0.1.1",
44
45
  "@stdlib/boolean-ctor": "^0.1.1",
45
46
  "@stdlib/utils-keys": "^0.1.0",
46
- "@stdlib/utils-try-require": "^0.1.1",
47
+ "@stdlib/utils-try-require": "^0.2.0",
47
48
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
48
49
  "istanbul": "^0.4.1",
49
50
  "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
50
51
  "@stdlib/bench-harness": "^0.1.2",
51
- "@stdlib/bench": "^0.2.1"
52
+ "@stdlib/bench": "^0.3.1"
52
53
  },
53
54
  "engines": {
54
55
  "node": ">=0.10.0",