@@ -84,7 +84,7 @@ static double tic( void ) {
8484*/
8585static float rand_float ( void ) {
8686 int r = rand ();
87- return (float )r / ( (float )RAND_MAX + 1.0 );
87+ return (float )r / ( (float )RAND_MAX + 1.0f );
8888}
8989
9090/**
@@ -102,7 +102,7 @@ static double benchmark1( int iterations, int len ) {
102102
103103 x = (float * ) malloc ( len * sizeof ( float ) );
104104 for ( i = 0 ; i < len ; i ++ ) {
105- x [ i ] = ( rand_float ()* 20.0 ) - 10.0 ;
105+ x [ i ] = ( rand_float ()* 20.0f ) - 10.0f ;
106106 }
107107 t = tic ();
108108 for ( i = 0 ; i < iterations ; i ++ ) {
@@ -135,7 +135,7 @@ static double benchmark2( int iterations, int len ) {
135135
136136 x = (float * ) malloc ( len * sizeof ( float ) );
137137 for ( i = 0 ; i < len ; i ++ ) {
138- x [ i ] = ( rand_float ()* 20.0 ) - 10.0 ;
138+ x [ i ] = ( rand_float ()* 20.0f ) - 10.0f ;
139139 }
140140 t = tic ();
141141 for ( i = 0 ; i < iterations ; i ++ ) {
@@ -174,7 +174,7 @@ int main( void ) {
174174 iter = ITERATIONS / pow ( 10 , i - 1 );
175175 for ( j = 0 ; j < REPEATS ; j ++ ) {
176176 count += 1 ;
177- printf ( "# c::%s:unsorted,random:len=%d\n" , NAME , len );
177+ printf ( "# c::%s:: unsorted,random:len=%d\n" , NAME , len );
178178 elapsed = benchmark1 ( iter , len );
179179 print_results ( iter , elapsed );
180180 printf ( "ok %d benchmark finished\n" , count );
0 commit comments