Skip to content

Commit c42828e

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 890943d commit c42828e

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

lib/node_modules/@stdlib/math/base/special/expf/docs/repl.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11

22
{{alias}}( x )
3-
4-
Evaluates the natural exponential function for
5-
a single-precision floating-point number.
3+
Evaluates the natural exponential function for a single-precision
4+
floating-point number.
65

76
Parameters
87
----------
@@ -17,7 +16,7 @@
1716
Examples
1817
--------
1918
> var y = {{alias}}( 4.0 )
20-
~54.598
19+
~54.5982
2120
> y = {{alias}}( -9.0 )
2221
~1.234e-4
2322
> y = {{alias}}( 0.0 )
@@ -27,4 +26,3 @@
2726

2827
See Also
2928
--------
30-
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2025 The Stdlib Authors.
4+
* Copyright (c) 2022 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -17,20 +17,17 @@
1717
*/
1818

1919
#include "stdlib/math/base/special/expf.h"
20-
#include <stdio.h>
2120
#include <stdlib.h>
21+
#include <stdio.h>
2222

2323
int main( void ) {
24-
float x[ 100 ];
24+
float x;
2525
float v;
2626
int i;
2727

2828
for ( i = 0; i < 100; i++ ) {
29-
x[ i ] = ( ( (float)rand() / (float)RAND_MAX ) * 100.0f );
30-
}
31-
32-
for ( i = 0; i < 100; i++ ) {
33-
v = stdlib_base_expf( x[ i ] );
34-
printf( "e^%f = %f\n", x[ i ], v );
29+
x = ( (float)rand() / (float)RAND_MAX ) * 100.0f;
30+
v = stdlib_base_expf( x );
31+
printf( "e^%f = %f\n", x, v );
3532
}
3633
}

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@
1919
'use strict';
2020

2121
var uniform = require( '@stdlib/random/array/uniform' );
22+
var logEachMap = require( '@stdlib/console/log-each-map' );
2223
var expf = require( './../lib' );
2324

24-
var x = uniform( 100, -50.0, 50.0, {
25+
var opts = {
2526
'dtype': 'float32'
26-
});
27+
};
28+
var x = uniform( 100, -50.0, 50.0, opts );
2729

28-
var i;
29-
for ( i = 0; i < 100; i++ ) {
30-
console.log( 'e^%f = %f', x, expf( x[ i ] ) );
31-
}
30+
logEachMap( 'e^%0.4f = %0.4f', x, expf );

0 commit comments

Comments
 (0)