@@ -32,29 +32,29 @@ static double rand_double() {
3232
3333int 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