Skip to content

Commit f13d569

Browse files
gunjjoshikgryte
andauthored
docs: update examples and fix whitespace
PR-URL: #2865 Ref: 6c8f019#r146319283 Ref: 6c8f019#r146319326 Ref: 6c8f019#r146319438 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]> Signed-off-by: Athan Reines <[email protected]>
1 parent 35462f8 commit f13d569

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# Logarithm
2222

23-
> Compute the base `b` [logarithm][logarithm] of a single-precision floating-point number..
23+
> Compute the base `b` [logarithm][logarithm] of a single-precision floating-point number.
2424
2525
<section class="usage">
2626

@@ -66,18 +66,19 @@ v = logf( 2.0, -4.0 );
6666
<!-- eslint no-undef: "error" -->
6767

6868
```javascript
69-
var randu = require( '@stdlib/random/base/randu' );
70-
var roundf = require( '@stdlib/math/base/special/roundf' );
69+
var randu = require( '@stdlib/random/array/discrete-uniform' );
7170
var logf = require( '@stdlib/math/base/special/logf' );
7271

73-
var b;
74-
var x;
75-
var i;
72+
var opts = {
73+
'dtype': 'float32'
74+
};
75+
76+
var x = randu( 100, 0, 100, opts );
77+
var b = randu( 100, 0, 5, opts );
7678

79+
var i;
7780
for ( i = 0; i < 100; i++ ) {
78-
x = roundf( randu() * 100.0 );
79-
b = roundf( randu() * 5.0 );
80-
console.log( 'logf( %d, %d ) = %d', x, b, logf( x, b ) );
81+
console.log( 'logf( %d, %d ) = %d', x[ i ], b[ i ], logf( x[ i ], b[ i ] ) );
8182
}
8283
```
8384

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@
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 logf = require( './../lib' );
2423

25-
var b;
26-
var x;
27-
var i;
24+
var opts = {
25+
'dtype': 'float32'
26+
};
27+
28+
var x = randu( 100, 0, 100, opts );
29+
var b = randu( 100, 0, 5, opts );
2830

31+
var i;
2932
for ( i = 0; i < 100; i++ ) {
30-
x = roundf( randu() * 100.0 );
31-
b = roundf( randu() * 5.0 );
32-
console.log( 'logf( %d, %d ) = %d', x, b, logf( x, b ) );
33+
console.log( 'logf( %d, %d ) = %d', x[ i ], b[ i ], logf( x[ i ], b[ i ] ) );
3334
}

lib/node_modules/@stdlib/math/base/special/logf/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* @param x input value
2626
* @param b input value
27-
* @return output value
27+
* @return output value
2828
*
2929
* @example
3030
* float out = stdlib_base_logf( 100.0f, 10.0f );

0 commit comments

Comments
 (0)