Re: bug in gtk+ (II)
- From: Owen Taylor <otaylor redhat com>
- To: gtk-devel-list gnome org
- Subject: Re: bug in gtk+ (II)
- Date: 26 Sep 2000 12:05:56 -0400
Wolfgang Sourdeau <wolfgang ultim net> writes:
> 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?
[ Straying off topic]
Well, yes, its a represntation like this, except for the fact that
both the mantissa (the 0.001) is stored as a binary fraction, not a
decimal fraction.
And everything that can be represented exactly in decimal can't be
represented exactly in binary. (Similar to the fact that there is no
exactly decimal representation for 1/3)
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]