I'd believe that: gdouble fraction = running_total * sqrt(num_sats_used) / num_sats_used / 100.0; What if num_sats_used is zero?
Then the answer will be 0, if you turn it around then it will "divison by zero"and it will crash. EDIT: didn't look close enough... yes it will crash if num_sats_used is 0. Sorry EDIT2: have to blame it on the early morning... need coffe...