Skip to content

Commit

Permalink
docs: update examples and fix whitespace
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
gunjjoshi and kgryte authored Sep 7, 2024
1 parent 35462f8 commit f13d569
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
19 changes: 10 additions & 9 deletions lib/node_modules/@stdlib/math/base/special/logf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<section class="usage">

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

```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 ] ) );
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] ) );
}
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/math/base/special/logf/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

1 comment on commit f13d569

@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
math/base/special/logf $\color{green}172/172$
$\color{green}+100.00\%$
$\color{green}5/5$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}172/172$
$\color{green}+100.00\%$

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

Please sign in to comment.