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

Re: Float Pt Precision



"Wes Bauske" <wsb@paralleldata.com> writes:

 > Just a programming style hint. Never do "if(fpval1 == fpval2)".
 > Alway do "if(ABS(fpval1-fpval2) < epsilon)". Pick an epsilon that
 > makes sense for your algorithm and the machine it's running on.

This isn't the place to get into a discussion about this.  Let me just
say that in general when you have higher precision registers then 1)
using tolerances don't always help and 2) reordering & different
optimization levels can significantly change results.  There was a
long discussoin of this on the egcs mailing list.

-- 
Harvey J. Stein
Bloomberg LP
hjstein@bfr.co.il



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