Skip to content

Commit 39339fa

Browse files
authored
style: fix indentation
Signed-off-by: Gunj Joshi <[email protected]>
1 parent 24a53ee commit 39339fa

File tree

1 file changed

+25
-25
lines changed
  • lib/node_modules/@stdlib/math/base/special/ldexp/examples/c

1 file changed

+25
-25
lines changed

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,29 @@ static double rand_double() {
3232

3333
int main( void ) {
3434
double sign;
35-
double frac;
36-
int32_t exp;
37-
double x;
38-
double v;
39-
int i;
40-
41-
for ( i = 0; i < 100; i++ ) {
42-
if ( rand_double() < 0.5 ) {
43-
sign = -1.0;
44-
} else {
45-
sign = 1.0;
46-
}
47-
// Generate a random number:
48-
frac = rand_double() * 10.0;
49-
exp = (int32_t)( rand_double()*616.0 ) - 308;
50-
x = sign * frac * pow( 10.0, exp );
51-
52-
// Break the number into a normalized fraction and an integer power of two:
53-
stdlib_base_frexp( x, &frac, &exp );
54-
55-
// Reconstitute the original number:
56-
v = stdlib_base_ldexp( frac, exp );
57-
58-
printf( "%e = %lf * 2^%" PRId32 " = %e\n", x, frac, exp, v );
59-
}
35+
double frac;
36+
int32_t exp;
37+
double x;
38+
double v;
39+
int i;
40+
41+
for ( i = 0; i < 100; i++ ) {
42+
if ( rand_double() < 0.5 ) {
43+
sign = -1.0;
44+
} else {
45+
sign = 1.0;
46+
}
47+
// Generate a random number:
48+
frac = rand_double() * 10.0;
49+
exp = (int32_t)( rand_double()*616.0 ) - 308;
50+
x = sign * frac * pow( 10.0, exp );
51+
52+
// Break the number into a normalized fraction and an integer power of two:
53+
stdlib_base_frexp( x, &frac, &exp );
54+
55+
// Reconstitute the original number:
56+
v = stdlib_base_ldexp( frac, exp );
57+
58+
printf( "%e = %lf * 2^%" PRId32 " = %e\n", x, frac, exp, v );
59+
}
6060
}

0 commit comments

Comments
 (0)