Skip to content

Commit

Permalink
docs: update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed May 25, 2024
1 parent 3f7f442 commit 2bb2164
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions lib/node_modules/@stdlib/complex/cmplx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,15 @@ var z = complex( 5.0, 3.0, 'float32' );
<!-- eslint no-undef: "error" -->

```javascript
var randu = require( '@stdlib/random/base/randu' );
var round = require( '@stdlib/math/base/special/round' );
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
var complex = require( '@stdlib/complex/cmplx' );

var re;
var im;
var rand = discreteUniform( -50, 50 );

var z;
var i;

for ( i = 0; i < 100; i++ ) {
re = round( (randu()*100.0) - 50.0 );
im = round( (randu()*100.0) - 50.0 );
z = complex( re, im, 'float64' );
z = complex( rand(), rand(), 'float64' );
console.log( z.toString() );
}
```
Expand Down
12 changes: 4 additions & 8 deletions lib/node_modules/@stdlib/complex/cmplx/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,14 @@

'use strict';

var randu = require( '@stdlib/random/base/randu' );
var round = require( '@stdlib/math/base/special/round' );
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory;
var complex = require( './../lib' );

var re;
var im;
var rand = discreteUniform( -50, 50 );

var z;
var i;

for ( i = 0; i < 100; i++ ) {
re = round( (randu()*100.0) - 50.0 );
im = round( (randu()*100.0) - 50.0 );
z = complex( re, im, 'float64' );
z = complex( rand(), rand(), 'float64' );
console.log( z.toString() );
}

1 comment on commit 2bb2164

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
complex/cmplx $\color{green}106/106$
$\color{green}+100.00\%$
$\color{green}7/7$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}106/106$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.