Skip to content

Commit 1a9528d

Browse files
authored
bench: fix value types
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
1 parent 3a700d0 commit 1a9528d

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

lib/node_modules/@stdlib/blas/ext/base/sindex-of-row/benchmark/c/benchmark.length.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ static void print_results( int iterations, float elapsed ) {
7373
*
7474
* @return clock time
7575
*/
76-
static float tic( void ) {
76+
static double tic( void ) {
7777
struct timeval now;
7878
gettimeofday( &now, NULL );
79-
return (float)now.tv_sec + (float)now.tv_usec/1.0e6;
79+
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
8080
}
8181

8282
/**
@@ -98,10 +98,10 @@ static float rand_float( void ) {
9898
*/
9999
static float benchmark1( int iterations, int N ) {
100100
uint8_t *workspace;
101-
float elapsed;
101+
double elapsed;
102102
float *A;
103103
float *x;
104-
float t;
104+
double t;
105105
int idx;
106106
int i;
107107
int j;
@@ -144,10 +144,10 @@ static float benchmark1( int iterations, int N ) {
144144
*/
145145
static float benchmark2( int iterations, int N ) {
146146
uint8_t *workspace;
147-
float elapsed;
147+
double elapsed;
148148
float *A;
149149
float *x;
150-
float t;
150+
double t;
151151
int idx;
152152
int i;
153153
int j;
@@ -185,7 +185,7 @@ static float benchmark2( int iterations, int N ) {
185185
* Main execution sequence.
186186
*/
187187
int main( void ) {
188-
float elapsed;
188+
double elapsed;
189189
int count;
190190
int iter;
191191
int len;
@@ -200,7 +200,7 @@ int main( void ) {
200200
count = 0;
201201
for ( i = MIN; i <= MAX; i++ ) {
202202
len = pow( 10, i );
203-
N = (int)sqrt( (float)len );
203+
N = (int)sqrt( (double)len );
204204
iter = ITERATIONS / pow( 10, i-1 );
205205
for ( j = 0; j < REPEATS; j++ ) {
206206
count += 1;

0 commit comments

Comments
 (0)