Skip to content

Commit 7923477

Browse files
committed
fix: correct indentation in C files
--- 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: na - 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: passed - task: lint_c_examples status: passed - task: lint_c_benchmarks status: passed - 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 175dc43 commit 7923477

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

lib/node_modules/@stdlib/stats/base/dists/lognormal/pdf/benchmark/c/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static double benchmark( void ) {
109109

110110
t = tic();
111111
for ( i = 0; i < ITERATIONS; i++ ) {
112-
y = stdlib_base_dists_lognormal_pdf( x[ i% 100 ], mu[ i % 100 ], sigma[ i % 100 ] );
112+
y = stdlib_base_dists_lognormal_pdf( x[ i % 100 ], mu[ i % 100 ], sigma[ i % 100 ] );
113113
if ( y != y ) {
114114
printf( "should not return NaN\n" );
115115
break;

lib/node_modules/@stdlib/stats/base/dists/lognormal/pdf/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static double random_uniform( const double min, const double max ) {
2929
int main( void ) {
3030
double sigma;
3131
double mu;
32-
double x;
32+
double x;
3333
double y;
3434
int i;
3535

lib/node_modules/@stdlib/stats/base/dists/lognormal/pdf/src/main.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,27 @@
3737
* // returns ~0.157
3838
*/
3939
double stdlib_base_dists_lognormal_pdf( const double x, const double mu, const double sigma ) {
40-
double exp_value;
41-
double lnx_u;
40+
double exp_value;
41+
double lnx_u;
4242
double s2;
43-
double z;
44-
double y;
43+
double z;
44+
double y;
4545
if (
46-
stdlib_base_is_nan( x ) ||
46+
stdlib_base_is_nan( x ) ||
4747
stdlib_base_is_nan( mu ) ||
4848
stdlib_base_is_nan( sigma ) ||
4949
sigma <= 0.0
5050
) {
5151
return 0.0 / 0.0; // NaN
5252
}
53-
if ( x <= 0.0 ) {
54-
return 0.0;
55-
}
56-
s2 = stdlib_base_pow( sigma, 2.0 );
57-
lnx_u = stdlib_base_pow( ( stdlib_base_ln( x ) - mu ), 2.0 );
58-
z = -lnx_u / ( 2.0 * s2 );
59-
exp_value = stdlib_base_exp( z );
60-
y = 1.0 / ( x * sigma * stdlib_base_sqrt( 2.0 * STDLIB_CONSTANT_FLOAT64_PI ) );
53+
if ( x <= 0.0 ) {
54+
return 0.0;
55+
}
56+
s2 = stdlib_base_pow( sigma, 2.0 );
57+
lnx_u = stdlib_base_pow( ( stdlib_base_ln( x ) - mu ), 2.0 );
58+
z = -lnx_u / ( 2.0 * s2 );
59+
exp_value = stdlib_base_exp( z );
60+
y = 1.0 / ( x * sigma * stdlib_base_sqrt( 2.0 * STDLIB_CONSTANT_FLOAT64_PI ) );
6161

62-
return y * exp_value;
62+
return y * exp_value;
6363
}

0 commit comments

Comments
 (0)