Re: Floating Point (was Non-strictly Weak Sorting using STL?)
On Jan 11, 9:39 pm, Kai-Uwe Bux <jkherci...@gmx.net> wrote:
Andy Champ wrote:
[...]
The results of floating point arithmetic are by and large
implementation defined (e.g., there is no guarantee that
addition of two floats yields a best possible approximation to
the sum of the represented numbers), but one could argue that
the standard requires addition to yield the actual sum if the
sum is representable).
I don't think it does. It's been a long time since I looked at
this, so the situation may have changed (and I may be
remembering things wrongly), but IIRC, the standard makes no
requirements with regards to the accuracy of floating point
arithmetic. From a QoI point of view (and IEEE does make such
requirements), I would expect one specific, well defined result,
but I don't think that the requirement really requires that; I
think that an implementation which always returns 0.0 for
floating point arithmetic would be formally conformant (but not
very useful).
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34