On Fri, Jun 5, 2009 at 7:14 PM, Brian Gough <[email protected]> wrote:

> At Tue, 2 Jun 2009 13:34:39 +0530,
> Awhan Patnaik wrote:
> >
> > With reference to int gsl_fcmp (double x, double y, double
> > epsilon) is there a default choice of epsilon that will work for
> > ``almost" all situations ?
>
>
> I think this really depends on the context, there is a discussion in
> Knuth which is the starting point and is worth checking out.
>

According to the definition of DBL_EPSILON

"Difference between 1 and the least value greater than 1 that is
representable. ". I was hoping that this would be a generic choice of
epsilon that would allow any computer to resolve between two floating point
numbers.

I have a code where I have to compare a lot of floating point numbers. In
most of the previous cases the ranges were in the  > 1.0 range but I soon
ran into a situation where I had to compare numbers of the order 1e-6 and
there I began to worry about the accuracy of my code.

Is there a way in which one can choose a context independent epsilon ?

-awhan
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to