Re: bug in gtk+ (II)



If I recall, the way floats are stored is in some kind of scientific
representation, that is 0.001=1E-3, isn't it?

IEEE numbers are stored in twos complement scientific notation format. The
mantissa is between 1 and 2, and the exponent is 2**power. So as you can see
everything is base 2. "tenths" (digit 1) tend not to translate exactly
because of the base 2 format. IEEE 854 does support base 10 floating point
numbers but I know of no processor that implements such a system.

Best Regards,
Norman Black
Stony Brook Software

----- Original Message -----
From: "Wolfgang Sourdeau" <wolfgang ultim net>
To: <gtk-devel-list gnome org>
Sent: Tuesday, September 26, 2000 08:42 AM
Subject: Re: bug in gtk+ (II)


La plume légère, à Tue, Sep 26, 2000 at 11:21:03AM -0400, heure
d'inpiration,
Havoc Pennington écrivait en ces mots:
This is just how floating point works; you lose precision. Floating
point can't actually represent the exact number you asked for, it
picks the closest one.

Yeah, I realize that. Although I can understand that fp numbers
can't be counted on for precision, I don't see why it's not possible
to obtain 1 + 0.001 = 1.001 instead of 1.000999993943 (or sth like this).
If I recall, the way floats are stored is in some kind of scientific
representation, that is 0.001=1E-3, isn't it?


Havoc

Wolfgang

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

_______________________________________________
gtk-devel-list mailing list
gtk-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list





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