Re: atof and VC7.1
From: Mycroft Holmes (m.holmes_at_nospam.it)
Date: 07/06/04
- Next message: Zilsch: "Re: Alternative memory managers"
- Previous message: Zilsch: "Re: Alternative memory managers"
- In reply to: David Webber: "Re: atof and VC7.1"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 6 Jul 2004 09:12:32 +0200
> Scientific programmers (who use floating point all the time) learn
> at their mother's knee NEVER to test for equality of floating point
> numbers. There are one or two exceptions (like testing for zero)
> but on the whole, even in that case, you are usually asking the
> wrong question.
>
> Usually what you need to know is
>
> if( abs( a-b) < epsilon )....;
>
> or some variation on this.
>
testing Ša-bŠ<eps is more a problem than a solution.
usually it applies when comparing a result with a constant, definetly not
when comparing two constants.
see for example (you already know it for sure)
http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/goldberg1.doc.html#674
-- The set of solutions is never empty. Two solutions together form a new problem. -- Mycroft Holmes
- Next message: Zilsch: "Re: Alternative memory managers"
- Previous message: Zilsch: "Re: Alternative memory managers"
- In reply to: David Webber: "Re: atof and VC7.1"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|