From 4a33b99962c7140934a7bf7c20be1dea8e019443 Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Mon, 15 Jul 2002 17:28:40 +0000 Subject: [PATCH] Fixed "calc error" bug. svn path=/trunk/boinc/; revision=196 --- client/speed_stats.C | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/client/speed_stats.C b/client/speed_stats.C index cdb98f3dfd..bbe819a4d1 100644 --- a/client/speed_stats.C +++ b/client/speed_stats.C @@ -265,6 +265,8 @@ void run_test_suite( double num_secs_per_test ) { } // One iteration == D_LOOP_ITERS (1,000,000) floating point operations +// If time_total is negative, there was an error in the calculation, +// meaning there is probably something wrong with the CPU clock_t double_flop_test( int iterations, int print_debug ) { double a[NUM_DOUBLES],t1,t2; @@ -314,10 +316,12 @@ clock_t double_flop_test( int iterations, int print_debug ) { calc_error = 1; } - temp /= 3; + temp /= 2; } - if( calc_error ) printf( "Calc error\n" ); + if( calc_error ) { + time_total *= -1; + } if( print_debug ) { for( i=0;i