~drizzle-trunk/drizzle/jenkins-Drizzle-Builder-155

« back to all changes in this revision

Viewing changes to drizzled/item/cmpfunc.h

  • Committer: Continuous Integration
  • Date: 2013-01-24 09:10:38 UTC
  • mfrom: (2616.1.1 7.2)
  • Revision ID: ci@drizzle.org-20130124091038-cg9n2npx2laqyr90
Merge lp:~brianaker/drizzle/warning-cleanup Build: jenkins-Drizzle-Builder-155

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include <drizzled/qsort_cmp.h>
36
36
#include <climits>
37
37
 
38
 
#pragma GCC diagnostic push
39
 
#pragma GCC diagnostic ignored "-Wfloat-equal"
40
 
 
41
 
static inline int compare_double(double f1, double f2)
42
 
{
43
 
  if (f1 == f2)
44
 
  {
45
 
    return 1;
46
 
  }
47
 
 
48
 
  return 0;
49
 
#if 0
50
 
  double diff= f1 - f2;
51
 
  return (diff < std::numeric_limits<double>::epsilon()) && (-diff > std::numeric_limits<double>::epsilon());
52
 
 
53
 
  double precision = 0.000001;
54
 
  if (((f1 - precision) < f2) && 
55
 
      ((f1 + precision) > f2))
56
 
  {
57
 
    return 1;
58
 
  }
59
 
  else
60
 
  {
61
 
    return 0;
62
 
  }
63
 
#endif
64
 
}
65
 
 
66
 
#pragma GCC diagnostic pop
67
 
 
68
 
static inline int compare_ne_double(double f1, double f2)
69
 
{
70
 
  return compare_double(f1, f2) == 1 ? 0 : 1;
71
 
}
 
38
#include "drizzled/compare_double.h"
72
39
 
73
40
namespace drizzled {
74
41