tesseract  4.0.0-1-g2a2b
host.h File Reference
#include <limits>
#include "platform.h"
#include <cinttypes>
#include <cstdint>

Go to the source code of this file.

Macros

#define TRUE   1
 
#define FALSE   0
 

Typedefs

using BOOL8 = unsigned char
 

Functions

template<class T >
bool NearlyEqual (T x, T y, T tolerance)
 

Macro Definition Documentation

◆ FALSE

#define FALSE   0

Definition at line 56 of file host.h.

◆ TRUE

#define TRUE   1

Definition at line 52 of file host.h.

Typedef Documentation

◆ BOOL8

using BOOL8 = unsigned char

Definition at line 34 of file host.h.

Function Documentation

◆ NearlyEqual()

template<class T >
bool NearlyEqual ( x,
y,
tolerance 
)

Definition at line 60 of file host.h.

60  {
61  T diff = x - y;
62  return diff <= tolerance && -diff <= tolerance;
63 }