Skip to content

Commit 79edd0f

Browse files
committed
refactor: fixed the formatting issues
--- 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: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - 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 815e870 commit 79edd0f

File tree

1 file changed

+8
-8
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/degenerate/mgf/benchmark/c

1 file changed

+8
-8
lines changed

lib/node_modules/@stdlib/stats/base/dists/degenerate/mgf/benchmark/c/benchmark.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
* limitations under the License.
1717
*/
1818

19+
#include <sys/time.h>
1920
#include "stdlib/stats/base/dists/degenerate/mgf.h"
20-
#include <stdlib.h>
21-
#include <stdio.h>
2221
#include <math.h>
22+
#include <stdio.h>
23+
#include <stdlib.h>
2324
#include <time.h>
24-
#include <sys/time.h>
2525

2626
#define NAME "degenerate-mgf"
2727
#define ITERATIONS 1000000
@@ -52,12 +52,12 @@ static void print_results( double elapsed ) {
5252
static double tic( void ) {
5353
struct timeval now;
5454
gettimeofday( &now, NULL );
55-
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
55+
return (double)now.tv_sec + (double)now.tv_usec / 1.0e6;
5656
}
5757

5858
static double random_uniform( const double min, const double max ) {
5959
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
60-
return min + ( v*(max-min) );
60+
return min + ( v * ( max - min ) );
6161
}
6262

6363
static double benchmark( void ) {
@@ -75,7 +75,7 @@ static double benchmark( void ) {
7575

7676
start = tic();
7777
for ( i = 0; i < ITERATIONS; i++ ) {
78-
y = stdlib_base_dists_degenerate_mgf( t[ i%100 ], mu[ i%100 ] );
78+
y = stdlib_base_dists_degenerate_mgf( t[ i % 100 ], mu[ i % 100 ] );
7979
if ( y != y ) { // Check for NaN
8080
printf( "should not return NaN\n" );
8181
break;
@@ -93,15 +93,15 @@ int main( void ) {
9393
double elapsed;
9494
int i;
9595

96-
// Seed the random number generator:
96+
// Seed the random number generator:
9797
srand( time( NULL ) );
9898

9999
print_version();
100100
for ( i = 0; i < REPEATS; i++ ) {
101101
printf( "# c::%s\n", NAME );
102102
elapsed = benchmark();
103103
print_results( elapsed );
104-
printf( "ok %d benchmark finished\n", i+1 );
104+
printf( "ok %d benchmark finished\n", i + 1 );
105105
}
106106
print_summary( REPEATS, REPEATS );
107107
}

0 commit comments

Comments
 (0)