Skip to content

Commit 539fbba

Browse files
committed
Auto-generated commit
1 parent 730f4fc commit 539fbba

3 files changed

Lines changed: 15 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ A total of 46 issues were closed in this release:
485485

486486
<details>
487487

488+
- [`ba76851`](https://github.com/stdlib-js/stdlib/commit/ba76851dd8983a3cd3974d06fc7af42c16e81a7f) - **docs:** replace manual `for` loop in examples _(by Karan Anand)_
488489
- [`ed88389`](https://github.com/stdlib-js/stdlib/commit/ed88389cdb8cdfb939e70e55d9167d8dc3984121) - **fix:** use correct type emulation _(by Karan Anand)_
489490
- [`24c131a`](https://github.com/stdlib-js/stdlib/commit/24c131a596fc7580774e0cd8966f4c512ed785e2) - **docs:** fix missing asterisk _(by Karan Anand)_
490491
- [`83da5c1`](https://github.com/stdlib-js/stdlib/commit/83da5c17c4a6d5f0dcfaf905e0612961a11d92db) - **feat:** add `acotdf` to namespace _(by Athan Reines)_

base/special/cinv/README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,16 @@ var im = imag( v );
7777
<!-- eslint no-undef: "error" -->
7878

7979
```javascript
80-
var Complex128 = require( '@stdlib/complex/float64/ctor' );
81-
var uniform = require( '@stdlib/random/base/uniform' );
80+
var Complex128Array = require( '@stdlib/array/complex64' );
81+
var uniform = require( '@stdlib/random/array/uniform' );
82+
var logEachMap = require( '@stdlib/console/log-each-map' );
8283
var cinv = require( '@stdlib/math/base/special/cinv' );
8384

84-
var z1;
85-
var z2;
86-
var i;
87-
88-
for ( i = 0; i < 100; i++ ) {
89-
z1 = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) );
90-
z2 = cinv( z1 );
85+
// Create an array of random numbers:
86+
var arr = new Complex128Array( uniform( 200, -100.0, 100.0 ) );
9187

92-
console.log( '1.0 / (%s) = %s', z1.toString(), z2.toString() );
93-
}
88+
// Compute the inverse of each number in the array:
89+
logEachMap( '1.0 / (%s) = %s', arr, cinv );
9490
```
9591

9692
</section>

base/special/cinv/examples/index.js

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

1919
'use strict';
2020

21-
var Complex128 = require( '@stdlib/complex/float64/ctor' );
22-
var uniform = require( '@stdlib/random/base/uniform' );
21+
var Complex128Array = require( '@stdlib/array/complex64' );
22+
var uniform = require( '@stdlib/random/array/uniform' );
23+
var logEachMap = require( '@stdlib/console/log-each-map' );
2324
var cinv = require( './../lib' );
2425

25-
var z1;
26-
var z2;
27-
var i;
26+
// Create an array of random numbers:
27+
var arr = new Complex128Array( uniform( 200, -100.0, 100.0 ) );
2828

29-
for ( i = 0; i < 100; i++ ) {
30-
z1 = new Complex128( uniform( -50.0, 50.0 ), uniform( -50.0, 50.0 ) );
31-
z2 = cinv( z1 );
32-
33-
console.log( '1.0 / (%s) = %s', z1.toString(), z2.toString() );
34-
}
29+
// Compute the inverse of each number in the array:
30+
logEachMap( '1.0 / (%s) = %s', arr, cinv );

0 commit comments

Comments
 (0)