View Single Post
gnuite's Avatar
Posts: 1,245 | Thanked: 421 times | Joined on Dec 2005
#129
Originally Posted by RussNelson
I'd believe that:

gdouble fraction = running_total * sqrt(num_sats_used)
/ num_sats_used / 100.0;

What if num_sats_used is zero?
Originally Posted by HardCoder
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...
Actually, since we're working with floating point numbers here, the answer will be 0.0 / 0.0, which resolves to NaN. This is almost definitely why some have seen the gtk_progress_set_percentage CRITICAL assertion failure, since the protective BOUND() call would not detect a NaN. I'm not sure if that would cause a force-quit, though, since it's not a FATAL assertion failure, but I haven't actually tested the case with 0 used satellites, so I can't say for sure either way.