Skip to content

Commit c54682d

Browse files
committed
docs: update examples
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: passed - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 00c9a8a commit c54682d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/node_modules/@stdlib/math/base/special/kernel-log1pf/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ int main( void ) {
2626
int i;
2727
for ( i = 0; i < 10; i++ ) {
2828
out = stdlib_base_kernel_log1pf( x[ i ] );
29-
printf ( "x[ i ]: %f, out: %f\n", x[ i ], out );
29+
printf ( "kernelLog1pf(%f) = %f\n", x[ i ], out );
3030
}
3131
}

lib/node_modules/@stdlib/math/base/special/kernel-log1pf/examples/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818

1919
'use strict';
2020

21-
var linspace = require( '@stdlib/array/base/linspace' );
21+
var uniform = require( '@stdlib/random/array/uniform' );
22+
var logEachMap = require( '@stdlib/console/log-each-map' );
2223
var sqrtf = require( '@stdlib/math/base/special/sqrtf' );
2324
var kernelLog1pf = require( './../lib' );
2425

25-
var x = linspace( sqrtf( 2.0 ) / 2.0, sqrtf( 2.0 ), 100 );
26+
var opts = {
27+
'dtype': 'float32'
28+
};
29+
var x = uniform( 100, sqrtf( 2.0 ) / 2.0, sqrtf( 2.0 ), opts );
2630

27-
var i;
28-
for ( i = 0; i < x.length; i++ ) {
29-
console.log( 'kernelLog1pf(%d) = %d', x[ i ], kernelLog1pf( x[ i ] ) );
30-
}
31+
logEachMap( 'kernelLog1pf(%0.4f) = %0.4f', x, kernelLog1pf );

0 commit comments

Comments
 (0)