From f13d56957a00c6ffea87a0cc7fd243cd871a213f Mon Sep 17 00:00:00 2001 From: Gunj Joshi Date: Sat, 7 Sep 2024 09:25:00 +0530 Subject: [PATCH] docs: update examples and fix whitespace PR-URL: https://github.com/stdlib-js/stdlib/pull/2865 Ref: https://github.com/stdlib-js/stdlib/commit/6c8f019db8adb12466250957693edb9830496a7b#r146319283 Ref: https://github.com/stdlib-js/stdlib/commit/6c8f019db8adb12466250957693edb9830496a7b#r146319326 Ref: https://github.com/stdlib-js/stdlib/commit/6c8f019db8adb12466250957693edb9830496a7b#r146319438 Co-authored-by: Athan Reines Reviewed-by: Athan Reines Signed-off-by: Athan Reines --- .../@stdlib/math/base/special/logf/README.md | 19 ++++++++++--------- .../math/base/special/logf/examples/index.js | 17 +++++++++-------- .../@stdlib/math/base/special/logf/src/main.c | 2 +- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/logf/README.md b/lib/node_modules/@stdlib/math/base/special/logf/README.md index 8a159148b33..f9dbab88d00 100644 --- a/lib/node_modules/@stdlib/math/base/special/logf/README.md +++ b/lib/node_modules/@stdlib/math/base/special/logf/README.md @@ -20,7 +20,7 @@ limitations under the License. # Logarithm -> Compute the base `b` [logarithm][logarithm] of a single-precision floating-point number.. +> Compute the base `b` [logarithm][logarithm] of a single-precision floating-point number.
@@ -66,18 +66,19 @@ v = logf( 2.0, -4.0 ); ```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 logf = require( '@stdlib/math/base/special/logf' ); -var b; -var x; -var i; +var opts = { + 'dtype': 'float32' +}; + +var x = randu( 100, 0, 100, opts ); +var b = randu( 100, 0, 5, opts ); +var i; for ( i = 0; i < 100; i++ ) { - x = roundf( randu() * 100.0 ); - b = roundf( randu() * 5.0 ); - console.log( 'logf( %d, %d ) = %d', x, b, logf( x, b ) ); + console.log( 'logf( %d, %d ) = %d', x[ i ], b[ i ], logf( x[ i ], b[ i ] ) ); } ``` diff --git a/lib/node_modules/@stdlib/math/base/special/logf/examples/index.js b/lib/node_modules/@stdlib/math/base/special/logf/examples/index.js index e04f893cb21..609da6ad28a 100644 --- a/lib/node_modules/@stdlib/math/base/special/logf/examples/index.js +++ b/lib/node_modules/@stdlib/math/base/special/logf/examples/index.js @@ -18,16 +18,17 @@ 'use strict'; -var randu = require( '@stdlib/random/base/randu' ); -var roundf = require( '@stdlib/math/base/special/roundf' ); +var randu = require( '@stdlib/random/array/discrete-uniform' ); var logf = require( './../lib' ); -var b; -var x; -var i; +var opts = { + 'dtype': 'float32' +}; + +var x = randu( 100, 0, 100, opts ); +var b = randu( 100, 0, 5, opts ); +var i; for ( i = 0; i < 100; i++ ) { - x = roundf( randu() * 100.0 ); - b = roundf( randu() * 5.0 ); - console.log( 'logf( %d, %d ) = %d', x, b, logf( x, b ) ); + console.log( 'logf( %d, %d ) = %d', x[ i ], b[ i ], logf( x[ i ], b[ i ] ) ); } diff --git a/lib/node_modules/@stdlib/math/base/special/logf/src/main.c b/lib/node_modules/@stdlib/math/base/special/logf/src/main.c index 11fcbe53f1a..e316a525ec0 100644 --- a/lib/node_modules/@stdlib/math/base/special/logf/src/main.c +++ b/lib/node_modules/@stdlib/math/base/special/logf/src/main.c @@ -24,7 +24,7 @@ * * @param x input value * @param b input value -* @return output value +* @return output value * * @example * float out = stdlib_base_logf( 100.0f, 10.0f );