bug in gtk+ (II)

printf rounds the gfloat to the correct percentage. But here is what
gdb gives me:

(gdb) print (float) perc
$9 = 0.999999702
(gdb) next
18                      gtk_progress_set_percentage (pbar, perc + .01);

Gtk-CRITICAL **: file gtkprogress.c: line 518 (gtk_progress_set_percentage): assertion `percentage >= 0 && percentage <= 1.0' failed.
19              }

Which makes sense.
Now, I don't see why perc = 0.999999702.

Investigating further:

When I initially set the percentage to 0.0,
gtk_progress_get_current_percentage returns
(gdb) print (float) perc
$10 = 1.40129846e-45

So either this is due to my floating point unit or to a real bug now.

A chicken is an egg's way of producing more eggs.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]