Skip to content

Commit d56924c

Browse files
committed
fix: rename function
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 0d46457 commit d56924c

File tree

10 files changed

+79
-78
lines changed

10 files changed

+79
-78
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ limitations under the License.
1818
1919
-->
2020

21-
# isAlmostEqualValue
21+
# isAlmostEqual
2222

2323
> Test whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place).
2424
@@ -37,10 +37,10 @@ limitations under the License.
3737
## Usage
3838

3939
```javascript
40-
var isAlmostEqualValue = require( '@stdlib/complex/float64/base/assert/is-almost-equal-value' );
40+
var isAlmostEqual = require( '@stdlib/complex/float64/base/assert/is-almost-equal' );
4141
```
4242

43-
#### isAlmostEqualValue( z1, z2, maxULP )
43+
#### isAlmostEqual( z1, z2, maxULP )
4444

4545
Tests whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place).
4646

@@ -51,10 +51,10 @@ var Complex128 = require( '@stdlib/complex/float64/ctor' );
5151
var z1 = new Complex128( 1.0, 3.0 );
5252
var z2 = new Complex128( 1.0+EPS, 3.0 );
5353

54-
var out = isAlmostEqualValue( z1, z2, 0 );
54+
var out = isAlmostEqual( z1, z2, 0 );
5555
// returns false
5656

57-
out = isAlmostEqualValue( z1, z2, 1 );
57+
out = isAlmostEqual( z1, z2, 1 );
5858
// returns true
5959
```
6060

@@ -66,16 +66,16 @@ var Complex128 = require( '@stdlib/complex/float64/ctor' );
6666
var z1 = new Complex128( NaN, 3.0 );
6767
var z2 = new Complex128( 1.0, 3.0 );
6868

69-
var out = isAlmostEqualValue( z1, z2, 1 );
69+
var out = isAlmostEqual( z1, z2, 1 );
7070
// returns false
7171

72-
out = isAlmostEqualValue( z2, z1, 1 );
72+
out = isAlmostEqual( z2, z1, 1 );
7373
// returns false
7474

7575
z1 = new Complex128( NaN, NaN );
7676
z2 = new Complex128( NaN, NaN );
7777

78-
out = isAlmostEqualValue( z1, z2, 1 );
78+
out = isAlmostEqual( z1, z2, 1 );
7979
// returns false
8080
```
8181

@@ -87,7 +87,7 @@ var Complex128 = require( '@stdlib/complex/float64/ctor' );
8787
var z1 = new Complex128( 0.0, 0.0 );
8888
var z2 = new Complex128( -0.0, -0.0 );
8989

90-
var out = isAlmostEqualValue( z1, z2, 0 );
90+
var out = isAlmostEqual( z1, z2, 0 );
9191
// returns true
9292
```
9393

@@ -114,26 +114,26 @@ var out = isAlmostEqualValue( z1, z2, 0 );
114114
```javascript
115115
var EPS = require( '@stdlib/constants/float64/eps' );
116116
var Complex128 = require( '@stdlib/complex/float64/ctor' );
117-
var isAlmostEqualValue = require( '@stdlib/complex/float64/base/assert/is-almost-equal-value' );
117+
var isAlmostEqual = require( '@stdlib/complex/float64/base/assert/is-almost-equal' );
118118

119119
var z1 = new Complex128( 1.0, 3.0+EPS );
120120
var z2 = new Complex128( 1.0+EPS, 3.0 );
121-
console.log( isAlmostEqualValue( z1, z2, 1 ) );
121+
console.log( isAlmostEqual( z1, z2, 1 ) );
122122
// => true
123123

124124
z1 = new Complex128( 1.0, 3.0+EPS );
125125
z2 = new Complex128( 1.0+EPS+EPS, 3.0 );
126-
console.log( isAlmostEqualValue( z1, z2, 1 ) );
126+
console.log( isAlmostEqual( z1, z2, 1 ) );
127127
// => false
128128

129129
z1 = new Complex128( 0.0, 0.0 );
130130
z2 = new Complex128( -0.0, 0.0 );
131-
console.log( isAlmostEqualValue( z1, z2, 0 ) );
131+
console.log( isAlmostEqual( z1, z2, 0 ) );
132132
// => true
133133

134134
z1 = new Complex128( NaN, 0.0 );
135135
z2 = new Complex128( 1.0, 0.0 );
136-
console.log( isAlmostEqualValue( z1, z2, 1 ) );
136+
console.log( isAlmostEqual( z1, z2, 1 ) );
137137
// => false
138138
```
139139

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var Complex128 = require( '@stdlib/complex/float64/ctor' );
2525
var randu = require( '@stdlib/random/base/randu' );
2626
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
2727
var pkg = require( './../package.json' ).name;
28-
var isAlmostEqualValue = require( './../lib' );
28+
var isAlmostEqual = require( './../lib' );
2929

3030

3131
// MAIN //
@@ -49,7 +49,7 @@ bench( pkg, function benchmark( b ) {
4949

5050
b.tic();
5151
for ( i = 0; i < b.iterations; i++ ) {
52-
v = isAlmostEqualValue( z1[ i%z1.length ], z2[ i%z2.length ], 1 );
52+
v = isAlmostEqual( z1[ i%z1.length ], z2[ i%z2.length ], 1 );
5353
if ( typeof v !== 'boolean' ) {
5454
b.fail( 'should return a boolean' );
5555
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ import Complex128 = require( '@stdlib/complex/float64/ctor' );
4040
* var z1 = new Complex128( 1.0, 3.0 );
4141
* var z2 = new Complex128( 1.0+EPS, 3.0 );
4242
*
43-
* var bool = isAlmostEqualValue( z1, z2, 0 );
43+
* var bool = isAlmostEqual( z1, z2, 0 );
4444
* // returns false
4545
*
46-
* bool = isAlmostEqualValue( z1, z2, 1 );
46+
* bool = isAlmostEqual( z1, z2, 1 );
4747
* // returns true
4848
*/
49-
declare function isAlmostEqualValue( z1: Complex128, z2: Complex128, maxULP: number ): boolean;
49+
declare function isAlmostEqual( z1: Complex128, z2: Complex128, maxULP: number ): boolean;
5050

5151

5252
// EXPORTS //
5353

54-
export = isAlmostEqualValue;
54+
export = isAlmostEqual;
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
import Complex128 = require( '@stdlib/complex/float64/ctor' );
20-
import isAlmostEqualValue = require( './index' );
20+
import isAlmostEqual = require( './index' );
2121

2222

2323
// TESTS //
@@ -27,42 +27,42 @@ import isAlmostEqualValue = require( './index' );
2727
const z1 = new Complex128( 5.0, 3.0 );
2828
const z2 = new Complex128( 5.0, 3.0 );
2929

30-
isAlmostEqualValue( z1, z2, 1 ); // $ExpectType boolean
30+
isAlmostEqual( z1, z2, 1 ); // $ExpectType boolean
3131
}
3232

3333
// The compiler throws an error if the function is provided a first argument that is not a complex number...
3434
{
3535
const z2 = new Complex128( 5.0, 3.0 );
3636

37-
isAlmostEqualValue( 'abc', z2, 1 ); // $ExpectError
38-
isAlmostEqualValue( 123, z2, 1 ); // $ExpectError
39-
isAlmostEqualValue( true, z2, 1 ); // $ExpectError
40-
isAlmostEqualValue( false, z2, 1 ); // $ExpectError
41-
isAlmostEqualValue( [], z2, 1 ); // $ExpectError
42-
isAlmostEqualValue( {}, z2, 1 ); // $ExpectError
43-
isAlmostEqualValue( ( x: number ): number => x, z2, 1 ); // $ExpectError
37+
isAlmostEqual( 'abc', z2, 1 ); // $ExpectError
38+
isAlmostEqual( 123, z2, 1 ); // $ExpectError
39+
isAlmostEqual( true, z2, 1 ); // $ExpectError
40+
isAlmostEqual( false, z2, 1 ); // $ExpectError
41+
isAlmostEqual( [], z2, 1 ); // $ExpectError
42+
isAlmostEqual( {}, z2, 1 ); // $ExpectError
43+
isAlmostEqual( ( x: number ): number => x, z2, 1 ); // $ExpectError
4444
}
4545

4646
// The compiler throws an error if the function is provided a second argument that is not a complex number...
4747
{
4848
const z1 = new Complex128( 5.0, 3.0 );
4949

50-
isAlmostEqualValue( z1, 'abc', 1 ); // $ExpectError
51-
isAlmostEqualValue( z1, 123, 1 ); // $ExpectError
52-
isAlmostEqualValue( z1, true, 1 ); // $ExpectError
53-
isAlmostEqualValue( z1, false, 1 ); // $ExpectError
54-
isAlmostEqualValue( z1, [], 1 ); // $ExpectError
55-
isAlmostEqualValue( z1, {}, 1 ); // $ExpectError
56-
isAlmostEqualValue( z1, ( x: number ): number => x, 1 ); // $ExpectError
50+
isAlmostEqual( z1, 'abc', 1 ); // $ExpectError
51+
isAlmostEqual( z1, 123, 1 ); // $ExpectError
52+
isAlmostEqual( z1, true, 1 ); // $ExpectError
53+
isAlmostEqual( z1, false, 1 ); // $ExpectError
54+
isAlmostEqual( z1, [], 1 ); // $ExpectError
55+
isAlmostEqual( z1, {}, 1 ); // $ExpectError
56+
isAlmostEqual( z1, ( x: number ): number => x, 1 ); // $ExpectError
5757
}
5858

5959
// The compiler throws an error if the function is provided an unsupported number of arguments...
6060
{
6161
const z1 = new Complex128( 5.0, 3.0 );
6262
const z2 = new Complex128( 5.0, 3.0 );
6363

64-
isAlmostEqualValue(); // $ExpectError
65-
isAlmostEqualValue( z1 ); // $ExpectError
66-
isAlmostEqualValue( z1, z2 ); // $ExpectError
67-
isAlmostEqualValue( z1, z2, 1, 1 ); // $ExpectError
64+
isAlmostEqual(); // $ExpectError
65+
isAlmostEqual( z1 ); // $ExpectError
66+
isAlmostEqual( z1, z2 ); // $ExpectError
67+
isAlmostEqual( z1, z2, 1, 1 ); // $ExpectError
6868
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@
2020

2121
var EPS = require( '@stdlib/constants/float64/eps' );
2222
var Complex128 = require( '@stdlib/complex/float64/ctor' );
23-
var isAlmostEqualValue = require( './../lib' );
23+
var isAlmostEqual = require( './../lib' );
2424

2525
var z1 = new Complex128( 1.0, 3.0+EPS );
2626
var z2 = new Complex128( 1.0+EPS, 3.0 );
27-
console.log( isAlmostEqualValue( z1, z2, 1 ) );
27+
console.log( isAlmostEqual( z1, z2, 1 ) );
2828
// => true
2929

3030
z1 = new Complex128( 1.0, 3.0+EPS );
3131
z2 = new Complex128( 1.0+EPS+EPS, 3.0 );
32-
console.log( isAlmostEqualValue( z1, z2, 1 ) );
32+
console.log( isAlmostEqual( z1, z2, 1 ) );
3333
// => false
3434

3535
z1 = new Complex128( 0.0, 0.0 );
3636
z2 = new Complex128( -0.0, 0.0 );
37-
console.log( isAlmostEqualValue( z1, z2, 0 ) );
37+
console.log( isAlmostEqual( z1, z2, 0 ) );
3838
// => true
3939

4040
z1 = new Complex128( NaN, 0.0 );
4141
z2 = new Complex128( 1.0, 0.0 );
42-
console.log( isAlmostEqualValue( z1, z2, 1 ) );
42+
console.log( isAlmostEqual( z1, z2, 1 ) );
4343
// => false
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@
2121
/**
2222
* Test whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place).
2323
*
24-
* @module @stdlib/complex/float64/base/assert/is-almost-equal-value
24+
* @module @stdlib/complex/float64/base/assert/is-almost-equal
2525
*
2626
* @example
2727
* var EPS = require( '@stdlib/constants/float64/eps' );
2828
* var Complex128 = require( '@stdlib/complex/float64/ctor' );
29-
* var isAlmostEqualValue = require( '@stdlib/complex/float64/base/assert/is-almost-equal-value' );
29+
* var isAlmostEqual = require( '@stdlib/complex/float64/base/assert/is-almost-equal' );
3030
*
3131
* var z1 = new Complex128( 1.0, 3.0 );
3232
* var z2 = new Complex128( 1.0+EPS, 3.0 );
3333
*
34-
* var bool = isAlmostEqualValue( z1, z2, 0 );
34+
* var bool = isAlmostEqual( z1, z2, 0 );
3535
* // returns false
3636
*
37-
* bool = isAlmostEqualValue( z1, z2, 1 );
37+
* bool = isAlmostEqual( z1, z2, 1 );
3838
* // returns true
3939
*/
4040

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
// MODULES //
2222

23+
// TODO: Update the import path to the correct package once the package is renamed.
2324
var isAlmostEqualValueF64 = require( '@stdlib/number/float64/base/assert/is-almost-equal-value' );
2425
var reim = require( '@stdlib/complex/float64/reim' );
2526

@@ -46,13 +47,13 @@ var reim = require( '@stdlib/complex/float64/reim' );
4647
* var z1 = new Complex128( 1.0, 3.0 );
4748
* var z2 = new Complex128( 1.0+EPS, 3.0 );
4849
*
49-
* var bool = isAlmostEqualValue( z1, z2, 0 );
50+
* var bool = isAlmostEqual( z1, z2, 0 );
5051
* // returns false
5152
*
52-
* bool = isAlmostEqualValue( z1, z2, 1 );
53+
* bool = isAlmostEqual( z1, z2, 1 );
5354
* // returns true
5455
*/
55-
function isAlmostEqualValue( z1, z2, maxULP ) {
56+
function isAlmostEqual( z1, z2, maxULP ) {
5657
var parts1 = reim( z1 );
5758
var parts2 = reim( z2 );
5859
return (
@@ -64,4 +65,4 @@ function isAlmostEqualValue( z1, z2, maxULP ) {
6465

6566
// EXPORTS //
6667

67-
module.exports = isAlmostEqualValue;
68+
module.exports = isAlmostEqual;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@stdlib/complex/float64/base/assert/is-almost-equal-value",
2+
"name": "@stdlib/complex/float64/base/assert/is-almost-equal",
33
"version": "0.0.0",
44
"description": "Test whether two double-precision complex floating-point numbers are approximately equal within a specified number of ULPs (units in the last place).",
55
"license": "Apache-2.0",

0 commit comments

Comments
 (0)