From 64a335a14f5cc6d2f76a8d2b38798678f6c54851 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 3 Dec 2024 22:13:38 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 1 + base/special/lcmf/README.md | 15 +++++---------- base/special/lcmf/examples/index.js | 15 +++++---------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9b1bff78..b968d4054 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2640,6 +2640,7 @@ A total of 5 people contributed to this release. Thank you to the following cont
+- [`299517a`](https://github.com/stdlib-js/stdlib/commit/299517a7a1e3494b93b2368c4f135a5826f88090) - **docs:** update examples in `math/base/special/lcmf` [(#3319)](https://github.com/stdlib-js/stdlib/pull/3319) _(by Gunj Joshi, Athan Reines)_ - [`7d8ab5a`](https://github.com/stdlib-js/stdlib/commit/7d8ab5a148946f94121316cc1dc5d22936e7ea57) - **feat:** add `ii_f` API in `math/base/napi/binary` [(#3315)](https://github.com/stdlib-js/stdlib/pull/3315) _(by Gunj Joshi)_ - [`c0d083d`](https://github.com/stdlib-js/stdlib/commit/c0d083d4329c439d9c002479740518584e5f5977) - **feat:** add `math/base/special/lcmf` _(by Aayush Khanna, stdlib-bot)_ - [`92c0d4e`](https://github.com/stdlib-js/stdlib/commit/92c0d4e65a8ffef2a2264ba906cfe8020c483b13) - **docs:** clean-up and use C floats when appropriate _(by Philipp Burckhardt)_ diff --git a/base/special/lcmf/README.md b/base/special/lcmf/README.md index 9215e3bac..516e540bb 100644 --- a/base/special/lcmf/README.md +++ b/base/special/lcmf/README.md @@ -101,20 +101,15 @@ v = lcmf( 48, NaN ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var roundf = require( '@stdlib/math/base/special/roundf' ); +var randu = require( '@stdlib/random/array/discrete-uniform' ); var lcmf = require( '@stdlib/math/base/special/lcmf' ); -var a; -var b; -var v; -var i; +var a = randu( 100, 0, 50 ); +var b = randu( 100, 0, 50 ); +var i; for ( i = 0; i < 100; i++ ) { - a = roundf( randu() * 50 ); - b = roundf( randu() * 50 ); - v = lcmf( a, b ); - console.log( 'lcmf(%d,%d) = %d', a, b, v ); + console.log( 'lcmf(%d,%d) = %d', a[ i ], b[ i ], lcmf( a[ i ], b[ i ] ) ); } ``` diff --git a/base/special/lcmf/examples/index.js b/base/special/lcmf/examples/index.js index 00f0d90b7..42f023a60 100644 --- a/base/special/lcmf/examples/index.js +++ b/base/special/lcmf/examples/index.js @@ -18,18 +18,13 @@ 'use strict'; -var randu = require( '@stdlib/random/base/randu' ); -var roundf = require( './../../../../base/special/roundf' ); +var randu = require( '@stdlib/random/array/discrete-uniform' ); var lcmf = require( './../lib' ); -var a; -var b; -var v; -var i; +var a = randu( 100, 0, 50 ); +var b = randu( 100, 0, 50 ); +var i; for ( i = 0; i < 100; i++ ) { - a = roundf( randu() * 50 ); - b = roundf( randu() * 50 ); - v = lcmf( a, b ); - console.log( 'lcmf(%d,%d) = %d', a, b, v ); + console.log( 'lcmf(%d,%d) = %d', a[ i ], b[ i ], lcmf( a[ i ], b[ i ] ) ); }