From 88f05d8a3e220cf10a959ee1da83626b97e03247 Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Wed, 12 Jun 2002 19:24:45 +0000 Subject: [PATCH] Fixed divide by zero bug. svn path=/trunk/boinc/; revision=111 --- client/speed_stats.C | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/client/speed_stats.C b/client/speed_stats.C index 7d4abb62fb..c7d3ef5288 100644 --- a/client/speed_stats.C +++ b/client/speed_stats.C @@ -320,34 +320,34 @@ clock_t int_op_test( int iterations, int print_debug ) { for( i=1;i=0;k-- ) { a[k] += 6; // 2 int ops } for( k=0;k=0;k-- ) { - a[k] -= 2; // 2 int ops - } - //for( k=NUM_INTS-1;k>0;k-- ) { - // a[k] -= a[k-1]; - //} - for( k=1;k0;k-- ) { - a[k] /= a[k-1]; + a[k] -= a[k-1]; // 5 int ops } - a[0] /= 2; for( k=1;k0;k-- ) { + if( a[k-1] != 0 ) // 7 int ops + a[k] /= a[k-1]; // 8 int ops + } + for( k=1;k