@stdlib/number-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/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">[`isSameValueZerof( a, b )`][@stdlib/number/float32/base/assert/is-same-value-zero]</span><span class="delimiter">: </span><span class="description">test if two single-precision floating-point numbers are the same value.</span>
72
+ - <span class="signature">[`isSameValuef( a, b )`][@stdlib/number/float32/base/assert/is-same-value]</span><span class="delimiter">: </span><span class="description">test if two single-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-float32-base-assert.svg
147
154
  [npm-url]: https://npmjs.org/package/@stdlib/number-float32-base-assert
148
155
 
149
- [test-image]: https://github.com/stdlib-js/number-float32-base-assert/actions/workflows/test.yml/badge.svg?branch=v0.1.0
150
- [test-url]: https://github.com/stdlib-js/number-float32-base-assert/actions/workflows/test.yml?query=branch:v0.1.0
156
+ [test-image]: https://github.com/stdlib-js/number-float32-base-assert/actions/workflows/test.yml/badge.svg?branch=v0.2.0
157
+ [test-url]: https://github.com/stdlib-js/number-float32-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-float32-base-assert/main.svg
153
160
  [coverage-url]: https://codecov.io/github/stdlib-js/number-float32-base-assert?branch=main
@@ -181,6 +188,10 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
181
188
 
182
189
  <!-- <toc-links> -->
183
190
 
191
+ [@stdlib/number/float32/base/assert/is-same-value-zero]: https://www.npmjs.com/package/@stdlib/number-float32-base-assert-is-same-value-zero
192
+
193
+ [@stdlib/number/float32/base/assert/is-same-value]: https://www.npmjs.com/package/@stdlib/number-float32-base-assert-is-same-value
194
+
184
195
  <!-- </toc-links> -->
185
196
 
186
197
  </section>
@@ -20,20 +20,90 @@
20
20
 
21
21
  /* eslint-disable max-lines */
22
22
 
23
- import isSameValue = require( '@stdlib/number-float32-base-assert-is-same-value' );
23
+ import isSameValuef = require( '@stdlib/number-float32-base-assert-is-same-value' );
24
+ import isSameValueZerof = require( '@stdlib/number-float32-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 single-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 single-precision floating-point numbers are the same value
40
+ *
41
+ * @example
42
+ * var toFloat32 = require( '@stdlib/number-float64-base-to-float32' );
43
+ *
44
+ * var bool = ns.isSameValuef( toFloat32( 3.14 ), toFloat32( 3.14 ) );
45
+ * // returns true
46
+ *
47
+ * @example
48
+ * var toFloat32 = require( '@stdlib/number-float64-base-to-float32' );
49
+ *
50
+ * var bool = ns.isSameValuef( toFloat32( -0.0 ), toFloat32( -0.0 ) );
51
+ * // returns true
52
+ *
53
+ * @example
54
+ * var toFloat32 = require( '@stdlib/number-float64-base-to-float32' );
55
+ *
56
+ * var bool = ns.isSameValuef( toFloat32( -0.0 ), toFloat32( 0.0 ) );
57
+ * // returns false
58
+ *
59
+ * @example
60
+ * var toFloat32 = require( '@stdlib/number-float64-base-to-float32' );
61
+ *
62
+ * var bool = ns.isSameValuef( toFloat32( NaN ), toFloat32( NaN ) );
63
+ * // returns true
31
64
  */
32
- isSameValue: typeof isSameValue;
65
+ isSameValuef: typeof isSameValuef;
66
+
67
+ /**
68
+ * Tests if two single-precision floating-point numbers are the same value.
69
+ *
70
+ * ## Notes
71
+ *
72
+ * - The function differs from the `===` operator in that the function treats `NaNs` as the same value.
73
+ *
74
+ * @param a - first input value
75
+ * @param b - second input value
76
+ * @returns boolean indicating whether two single-precision floating-point numbers are the same value
77
+ *
78
+ * @example
79
+ * var toFloat32 = require( '@stdlib/number-float64-base-to-float32' );
80
+ *
81
+ * var bool = ns.isSameValueZerof( toFloat32( 3.14 ), toFloat32( 3.14 ) );
82
+ * // returns true
83
+ *
84
+ * @example
85
+ * var toFloat32 = require( '@stdlib/number-float64-base-to-float32' );
86
+ *
87
+ * var bool = ns.isSameValueZerof( toFloat32( -0.0 ), toFloat32( -0.0 ) );
88
+ * // returns true
89
+ *
90
+ * @example
91
+ * var toFloat32 = require( '@stdlib/number-float64-base-to-float32' );
92
+ *
93
+ * var bool = ns.isSameValueZerof( toFloat32( -0.0 ), toFloat32( 0.0 ) );
94
+ * // returns true
95
+ *
96
+ * @example
97
+ * var toFloat32 = require( '@stdlib/number-float64-base-to-float32' );
98
+ *
99
+ * var bool = ns.isSameValueZerof( toFloat32( NaN ), toFloat32( NaN ) );
100
+ * // returns true
101
+ */
102
+ isSameValueZerof: typeof isSameValueZerof;
33
103
  }
34
104
 
35
105
  /**
36
- * Base single-precision floating-point number assert functions.
106
+ * Base double-precision floating-point number assert functions.
37
107
  */
38
108
  declare var ns: Namespace;
39
109
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/number-float32-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,21 +36,21 @@
36
36
  "url": "https://github.com/stdlib-js/stdlib/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@stdlib/number-float32-base-assert-is-same-value": "^0.1.0",
40
- "@stdlib/number-float32-base-assert-is-same-value-zero": "^0.1.0",
41
- "@stdlib/utils-define-read-only-property": "^0.1.1"
39
+ "@stdlib/number-float32-base-assert-is-same-value": "^0.2.0",
40
+ "@stdlib/number-float32-base-assert-is-same-value-zero": "^0.2.0",
41
+ "@stdlib/utils-define-read-only-property": "^0.2.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@stdlib/assert-is-boolean": "^0.1.1",
45
45
  "@stdlib/boolean-ctor": "^0.1.1",
46
46
  "@stdlib/number-float64-base-to-float32": "^0.1.1",
47
47
  "@stdlib/utils-keys": "^0.1.0",
48
- "@stdlib/utils-try-require": "^0.1.1",
48
+ "@stdlib/utils-try-require": "^0.2.0",
49
49
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
50
50
  "istanbul": "^0.4.1",
51
51
  "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
52
52
  "@stdlib/bench-harness": "^0.1.2",
53
- "@stdlib/bench": "^0.2.1"
53
+ "@stdlib/bench": "^0.3.1"
54
54
  },
55
55
  "engines": {
56
56
  "node": ">=0.10.0",