Skip to content

Commit 299517a

Browse files
gunjjoshikgryte
andauthored
docs: update examples in math/base/special/lcmf
PR-URL: #3319 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]> Signed-off-by: Athan Reines <[email protected]>
1 parent e5d32c5 commit 299517a

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,15 @@ v = lcmf( 48, NaN );
101101
<!-- eslint no-undef: "error" -->
102102

103103
```javascript
104-
var randu = require( '@stdlib/random/base/randu' );
105-
var roundf = require( '@stdlib/math/base/special/roundf' );
104+
var randu = require( '@stdlib/random/array/discrete-uniform' );
106105
var lcmf = require( '@stdlib/math/base/special/lcmf' );
107106

108-
var a;
109-
var b;
110-
var v;
111-
var i;
107+
var a = randu( 100, 0, 50 );
108+
var b = randu( 100, 0, 50 );
112109

110+
var i;
113111
for ( i = 0; i < 100; i++ ) {
114-
a = roundf( randu() * 50 );
115-
b = roundf( randu() * 50 );
116-
v = lcmf( a, b );
117-
console.log( 'lcmf(%d,%d) = %d', a, b, v );
112+
console.log( 'lcmf(%d,%d) = %d', a[ i ], b[ i ], lcmf( a[ i ], b[ i ] ) );
118113
}
119114
```
120115

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@
1818

1919
'use strict';
2020

21-
var randu = require( '@stdlib/random/base/randu' );
22-
var roundf = require( '@stdlib/math/base/special/roundf' );
21+
var randu = require( '@stdlib/random/array/discrete-uniform' );
2322
var lcmf = require( './../lib' );
2423

25-
var a;
26-
var b;
27-
var v;
28-
var i;
24+
var a = randu( 100, 0, 50 );
25+
var b = randu( 100, 0, 50 );
2926

27+
var i;
3028
for ( i = 0; i < 100; i++ ) {
31-
a = roundf( randu() * 50 );
32-
b = roundf( randu() * 50 );
33-
v = lcmf( a, b );
34-
console.log( 'lcmf(%d,%d) = %d', a, b, v );
29+
console.log( 'lcmf(%d,%d) = %d', a[ i ], b[ i ], lcmf( a[ i ], b[ i ] ) );
3530
}

0 commit comments

Comments
 (0)