Skip to content

Commit dc28013

Browse files
committed
chore: indentation fixes
1 parent 01f6fd3 commit dc28013

File tree

3 files changed

+58
-58
lines changed

3 files changed

+58
-58
lines changed

lib/node_modules/@stdlib/math/base/special/lucasf/benchmark/c/native/benchmark.c

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* Prints the TAP version.
3232
*/
3333
void print_version() {
34-
printf( "TAP version 13\n" );
34+
printf( "TAP version 13\n" );
3535
}
3636

3737
/**
@@ -41,12 +41,12 @@ void print_version() {
4141
* @param passing total number of passing tests
4242
*/
4343
static void print_summary( int total, int passing ) {
44-
printf( "#\n" );
45-
printf( "1..%d\n", total ); // TAP plan
46-
printf( "# total %d\n", total );
47-
printf( "# pass %d\n", passing );
48-
printf( "#\n" );
49-
printf( "# ok\n" );
44+
printf( "#\n" );
45+
printf( "1..%d\n", total ); // TAP plan
46+
printf( "# total %d\n", total );
47+
printf( "# pass %d\n", passing );
48+
printf( "#\n" );
49+
printf( "# ok\n" );
5050
}
5151

5252
/**
@@ -55,12 +55,12 @@ static void print_summary( int total, int passing ) {
5555
* @param elapsed elapsed time in seconds
5656
*/
5757
static void print_results( double elapsed ) {
58-
double rate = (double)ITERATIONS / elapsed;
59-
printf( " ---\n" );
60-
printf( " iterations: %d\n", ITERATIONS );
61-
printf( " elapsed: %0.9f\n", elapsed );
62-
printf( " rate: %0.9f\n", rate );
63-
printf( " ...\n" );
58+
double rate = (double)ITERATIONS / elapsed;
59+
printf( " ---\n" );
60+
printf( " iterations: %d\n", ITERATIONS );
61+
printf( " elapsed: %0.9f\n", elapsed );
62+
printf( " rate: %0.9f\n", rate );
63+
printf( " ...\n" );
6464
}
6565

6666
/**
@@ -69,9 +69,9 @@ static void print_results( double elapsed ) {
6969
* @return clock time
7070
*/
7171
static double tic( void ) {
72-
struct timeval now;
73-
gettimeofday( &now, NULL );
74-
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
72+
struct timeval now;
73+
gettimeofday( &now, NULL );
74+
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
7575
}
7676

7777
/**
@@ -80,8 +80,8 @@ static double tic( void ) {
8080
* @return random number
8181
*/
8282
static float rand_float( void ) {
83-
int r = rand();
84-
return (float)r / ( (float)RAND_MAX + 1.0f );
83+
int r = rand();
84+
return (float)r / ( (float)RAND_MAX + 1.0f );
8585
}
8686

8787
/**
@@ -90,47 +90,47 @@ static float rand_float( void ) {
9090
* @return elapsed time in seconds
9191
*/
9292
static double benchmark( void ) {
93-
double elapsed;
94-
int32_t x[ 100 ];
95-
double t;
96-
float y;
97-
int i;
93+
double elapsed;
94+
int32_t x[ 100 ];
95+
double t;
96+
float y;
97+
int i;
9898

9999
for ( i = 0 ; i < 100 ; i++ ) {
100100
x[ i ] = ( int32_t )( 34.0f * rand_float() );
101101
}
102102

103-
t = tic();
104-
for ( i = 0; i < ITERATIONS; i++ ) {
105-
y = stdlib_base_lucasf( x[ i % 100 ] );
106-
if ( y != y ) {
107-
printf( "should not return NaN\n" );
108-
break;
109-
}
110-
}
111-
elapsed = tic() - t;
112-
if ( y != y ) {
113-
printf( "should not return NaN\n" );
114-
}
115-
return elapsed;
103+
t = tic();
104+
for ( i = 0; i < ITERATIONS; i++ ) {
105+
y = stdlib_base_lucasf( x[ i % 100 ] );
106+
if ( y != y ) {
107+
printf( "should not return NaN\n" );
108+
break;
109+
}
110+
}
111+
elapsed = tic() - t;
112+
if ( y != y ) {
113+
printf( "should not return NaN\n" );
114+
}
115+
return elapsed;
116116
}
117117

118118
/**
119119
* Main execution sequence.
120120
*/
121121
int main( void ) {
122-
double elapsed;
123-
int i;
122+
double elapsed;
123+
int i;
124124

125-
// Use the current time to seed the random number generator:
126-
srand( time( NULL ) );
125+
// Use the current time to seed the random number generator:
126+
srand( time( NULL ) );
127127

128-
print_version();
129-
for ( i = 0; i < REPEATS; i++ ) {
130-
printf( "# c::native::%s\n", NAME );
131-
elapsed = benchmark();
132-
print_results( elapsed );
133-
printf( "ok %d benchmark finished\n", i+1 );
134-
}
135-
print_summary( REPEATS, REPEATS );
128+
print_version();
129+
for ( i = 0; i < REPEATS; i++ ) {
130+
printf( "# c::native::%s\n", NAME );
131+
elapsed = benchmark();
132+
print_results( elapsed );
133+
printf( "ok %d benchmark finished\n", i+1 );
134+
}
135+
print_summary( REPEATS, REPEATS );
136136
}

lib/node_modules/@stdlib/math/base/special/lucasf/examples/c/example.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
#include <stdint.h>
2222

2323
int main( void ) {
24-
int32_t i;
25-
float v;
24+
int32_t i;
25+
float v;
2626

27-
for ( i = 0; i < 35; i++ ) {
28-
v = stdlib_base_lucasf( i );
29-
printf( "lucasf(%d) = %f\n", i, v );
30-
}
27+
for ( i = 0; i < 35; i++ ) {
28+
v = stdlib_base_lucasf( i );
29+
printf( "lucasf(%d) = %f\n", i, v );
30+
}
3131
}

lib/node_modules/@stdlib/math/base/special/lucasf/src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ static const int32_t lucas_value[ 35 ] = {
7272
* // returns NaN
7373
*/
7474
float stdlib_base_lucasf( const int32_t n ) {
75-
if ( n < 0 || n > STDLIB_CONSTANT_FLOAT32_MAX_SAFE_NTH_LUCAS ) {
76-
return 0.0f / 0.0f; // NaN
77-
}
78-
return lucas_value[ n ];
75+
if ( n < 0 || n > STDLIB_CONSTANT_FLOAT32_MAX_SAFE_NTH_LUCAS ) {
76+
return 0.0f / 0.0f; // NaN
77+
}
78+
return lucas_value[ n ];
7979
}

0 commit comments

Comments
 (0)