src/Generic/parse/ChartDecoder.cpp
// ripped this off from gsl library

ripped this off from gsl library
ripped this off from gsl library
static int
__fcmp (const double x1, const double x2, const double epsilon = 1.e-6)
{
  int exponent;
  double delta, difference;
  {
    double max = (fabs (x1) > fabs (x2)) ? x1 : x2;
    frexp (max, &exponent);
  }
  delta = ldexp (epsilon, exponent);
  difference = x1 - x2;
  if (difference > delta)       
    {
      return 1;
    }
  else if (difference < -delta) 
    {
      return -1;
    }
  else                          
    {
      return 0;                 
    }
}
static int __fcmp ( const double x1 , const double x2 , const double epsilon = 1.e-6 ) { int exponent ; double delta , difference ; { double max = ( fabs ( x1 ) > fabs ( x2 ) ) ? x1 : x2 ; frexp ( max , & exponent ) ; } delta = ldexp ( epsilon , exponent ) ; difference = x1 - x2 ; if ( difference > delta ) { return 1 ; } else if ( difference < - delta ) { return -1 ; } else { return 0 ; } }
ripped this off from gsl library
ripped this off from gsl library
/* Find exponent of largest absolute value */ /* Form a neighborhood of size  2 * delta */ /* x1 > x2 */ /* x1 < x2 */ /* -delta <= difference <= delta */ /* x1 ~=~ x2 */