Skip to content

Commit 64f1566

Browse files
committed
chore: apply suggestions from review
--- 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: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - 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 25aa71e commit 64f1566

File tree

4 files changed

+18
-34
lines changed

4 files changed

+18
-34
lines changed

lib/node_modules/@stdlib/math/base/special/cpolarf/README.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,16 @@ var bool = ( v === out );
7575
<!-- eslint no-undef: "error" -->
7676

7777
```javascript
78-
var Complex64 = require( '@stdlib/complex/float32/ctor' );
79-
var uniform = require( '@stdlib/random/base/uniform' );
78+
var Complex64Array = require( '@stdlib/array/complex64' );
79+
var uniform = require( '@stdlib/random/array/uniform' );
80+
var logEachMap = require( '@stdlib/console/log-each-map' );
8081
var cpolarf = require( '@stdlib/math/base/special/cpolarf' );
8182

82-
var re;
83-
var im;
84-
var z;
85-
var o;
86-
var i;
87-
88-
for ( i = 0; i < 100; i++ ) {
89-
re = uniform( -50.0, 50.0 );
90-
im = uniform( -50.0, 50.0 );
91-
z = new Complex64( re, im );
92-
o = cpolarf( z );
93-
z = z.toString();
94-
console.log( 'absf(%s) = %d. argf(%s) = %d', z, o[ 0 ], z, o[ 1 ] );
95-
}
83+
// Create an array of random numbers:
84+
var arr = new Complex64Array( uniform( 200, -100.0, 100.0 ) );
85+
86+
// Compute the polar form of each number in the array:
87+
logEachMap( 'cpolarf(%s) = [%s]', arr, cpolarf );
9688
```
9789

9890
</section>
@@ -147,7 +139,7 @@ The function accepts the following arguments:
147139
- **cphasef**: `[out] float*` destination for the phase value in radians.
148140
149141
```c
150-
float stdlib_base_cpolarf( const stdlib_complex64_t z, float *cabsf, float *cphasef );
142+
void stdlib_base_cpolarf( const stdlib_complex64_t z, float *cabsf, float *cphasef );
151143
```
152144

153145
</section>

lib/node_modules/@stdlib/math/base/special/cpolarf/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ interface Cpolar {
3939
* var v = cpolarf( new Complex64( 5.0, 3.0 ) );
4040
* // returns [ ~5.83, ~0.5404 ]
4141
*/
42-
( z: Complex64 ): Array<number>;
42+
( z: Complex64 ): [ number, number ];
4343

4444
/**
4545
* Computes the absolute value and the phase of a single-precision complex floating-point number and assigns results to a provided output array.

lib/node_modules/@stdlib/math/base/special/cpolarf/docs/types/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import cpolarf = require( './index' );
2424

2525
// The function returns an array of numbers...
2626
{
27-
cpolarf( new Complex64( 5.0, 3.0 ) ); // $ExpectType number[]
27+
cpolarf( new Complex64( 5.0, 3.0 ) ); // $ExpectType [number, number]
2828
}
2929

3030
// The compiler throws an error if the function is provided a complex number...

lib/node_modules/@stdlib/math/base/special/cpolarf/examples/index.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,13 @@
1818

1919
'use strict';
2020

21-
var Complex64 = require( '@stdlib/complex/float32/ctor' );
22-
var uniform = require( '@stdlib/random/base/uniform' );
21+
var Complex64Array = require( '@stdlib/array/complex64' );
22+
var uniform = require( '@stdlib/random/array/uniform' );
23+
var logEachMap = require( '@stdlib/console/log-each-map' );
2324
var cpolarf = require( './../lib' );
2425

25-
var re;
26-
var im;
27-
var z;
28-
var o;
29-
var i;
26+
// Create an array of random numbers:
27+
var arr = new Complex64Array( uniform( 200, -100.0, 100.0 ) );
3028

31-
for ( i = 0; i < 100; i++ ) {
32-
re = uniform( -50.0, 50.0 );
33-
im = uniform( -50.0, 50.0 );
34-
z = new Complex64( re, im );
35-
o = cpolarf( z );
36-
z = z.toString();
37-
console.log( 'absf(%s) = %d. argf(%s) = %d', z, o[ 0 ], z, o[ 1 ] );
38-
}
29+
// Compute the polar form of each number in the array:
30+
logEachMap( 'cpolarf(%s) = [%s]', arr, cpolarf );

0 commit comments

Comments
 (0)