~vcs-imports/tesseract-ocr/trunk

« back to all changes in this revision

Viewing changes to ccutil/host.h

  • Committer: theraysmith
  • Date: 2008-12-30 18:20:15 UTC
  • Revision ID: svn-v4:d0cd1f9f-072b-0410-8dd7-cf729c803f20:trunk:209
Harmless improvements from 3.00 going in to 2.04

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
#define NULL            0L
172
172
#endif
173
173
 
 
174
// Return true if x is within tolerance of y
 
175
template<class T> bool NearlyEqual(T x, T y, T tolerance) {
 
176
  T diff = x - y;
 
177
  return diff <= tolerance && -diff <= tolerance;
 
178
}
 
179
 
174
180
#endif