Skip to content

Commit 50ffb8e

Browse files
docs: improve doctests for complex number instances in array/to-fancy
PR-URL: #11974 Reviewed-by: Athan Reines <kgryte@gmail.com> Ref: stdlib-js/metr-issue-tracker#516 Ref: #4833
1 parent ccec3e4 commit 50ffb8e

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

  • lib/node_modules/@stdlib/array/to-fancy

lib/node_modules/@stdlib/array/to-fancy/README.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -428,33 +428,19 @@ When assigning a real-valued scalar to a complex number array (e.g., [`Complex12
428428

429429
```javascript
430430
var Complex128Array = require( '@stdlib/array/complex128' );
431-
var real = require( '@stdlib/complex/float64/real' );
432-
var imag = require( '@stdlib/complex/float64/imag' );
433431

434432
var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
435433
var y = array2fancy( x );
436434

437435
// Retrieve the first element:
438436
var v = y[ 0 ];
439-
// returns <Complex128>
440-
441-
var re = real( v );
442-
// returns 1.0
443-
444-
var im = imag( v );
445-
// returns 2.0
437+
// returns <Complex128>[ 1.0, 2.0 ]
446438

447439
// Assign a real-valued scalar to the first element:
448440
y[ 0 ] = 9.0;
449441

450442
v = y[ 0 ];
451-
// returns <Complex128>
452-
453-
re = real( v );
454-
// returns 9.0
455-
456-
im = imag( v );
457-
// returns 0.0
443+
// returns <Complex128>[ 9.0, 0.0 ]
458444
```
459445

460446
</section>

0 commit comments

Comments
 (0)