ATLAS Offline Software
Functions
CxxUtils::fpcompare Namespace Reference

Functions

bool equal (double a, double b)
 Compare two FP numbers, working around x87 precision issues. More...
 
bool equal (float a, float b)
 Compare two FP numbers, working around x87 precision issues. More...
 
bool greater (double a, double b)
 Compare two FP numbers, working around x87 precision issues. More...
 
bool greater (float a, float b)
 Compare two FP numbers, working around x87 precision issues. More...
 
bool less (double a, double b)
 Compare two FP numbers, working around x87 precision issues. More...
 
bool less (float a, float b)
 Compare two FP numbers, working around x87 precision issues. More...
 
bool greater_equal (double a, double b)
 Compare two FP numbers, working around x87 precision issues. More...
 
bool greater_equal (float a, float b)
 Compare two FP numbers, working around x87 precision issues. More...
 
bool less_equal (double a, double b)
 Compare two FP numbers, working around x87 precision issues. More...
 
bool less_equal (float a, float b)
 Compare two FP numbers, working around x87 precision issues. More...
 

Function Documentation

◆ equal() [1/2]

bool CxxUtils::fpcompare::equal ( double  a,
double  b 
)
inline

Compare two FP numbers, working around x87 precision issues.

Returns
a == b

Definition at line 114 of file fpcompare.h.

115 {
116  CXXUTILS_FPCOMPARE_VOLATILE double va = a;
117  CXXUTILS_FPCOMPARE_VOLATILE double vb = b;
118  return va == vb;
119 }

◆ equal() [2/2]

bool CxxUtils::fpcompare::equal ( float  a,
float  b 
)
inline

Compare two FP numbers, working around x87 precision issues.

Returns
a == b

Definition at line 127 of file fpcompare.h.

128 {
129  CXXUTILS_FPCOMPARE_VOLATILE float va = a;
130  CXXUTILS_FPCOMPARE_VOLATILE float vb = b;
131  return va == vb;
132 }

◆ greater() [1/2]

bool CxxUtils::fpcompare::greater ( double  a,
double  b 
)
inline

Compare two FP numbers, working around x87 precision issues.

Returns
a > b

Definition at line 140 of file fpcompare.h.

141 {
142  CXXUTILS_FPCOMPARE_VOLATILE double va = a;
143  CXXUTILS_FPCOMPARE_VOLATILE double vb = b;
144  return va > vb;
145 }

◆ greater() [2/2]

bool CxxUtils::fpcompare::greater ( float  a,
float  b 
)
inline

Compare two FP numbers, working around x87 precision issues.

Returns
a > b

Definition at line 153 of file fpcompare.h.

154 {
155  CXXUTILS_FPCOMPARE_VOLATILE float va = a;
156  CXXUTILS_FPCOMPARE_VOLATILE float vb = b;
157  return va > vb;
158 }

◆ greater_equal() [1/2]

bool CxxUtils::fpcompare::greater_equal ( double  a,
double  b 
)
inline

Compare two FP numbers, working around x87 precision issues.

Returns
a >= b

Definition at line 192 of file fpcompare.h.

193 {
194  CXXUTILS_FPCOMPARE_VOLATILE double va = a;
195  CXXUTILS_FPCOMPARE_VOLATILE double vb = b;
196  return va >= vb;
197 }

◆ greater_equal() [2/2]

bool CxxUtils::fpcompare::greater_equal ( float  a,
float  b 
)
inline

Compare two FP numbers, working around x87 precision issues.

Returns
a >= b

Definition at line 205 of file fpcompare.h.

206 {
207  CXXUTILS_FPCOMPARE_VOLATILE float va = a;
208  CXXUTILS_FPCOMPARE_VOLATILE float vb = b;
209  return va >= vb;
210 }

◆ less() [1/2]

bool CxxUtils::fpcompare::less ( double  a,
double  b 
)
inline

Compare two FP numbers, working around x87 precision issues.

Returns
a < b

Definition at line 166 of file fpcompare.h.

167 {
168  CXXUTILS_FPCOMPARE_VOLATILE double va = a;
169  CXXUTILS_FPCOMPARE_VOLATILE double vb = b;
170  return va < vb;
171 }

◆ less() [2/2]

bool CxxUtils::fpcompare::less ( float  a,
float  b 
)
inline

Compare two FP numbers, working around x87 precision issues.

Returns
a < b

Definition at line 179 of file fpcompare.h.

180 {
181  CXXUTILS_FPCOMPARE_VOLATILE float va = a;
182  CXXUTILS_FPCOMPARE_VOLATILE float vb = b;
183  return va < vb;
184 }

◆ less_equal() [1/2]

bool CxxUtils::fpcompare::less_equal ( double  a,
double  b 
)
inline

Compare two FP numbers, working around x87 precision issues.

Returns
a <= b

Definition at line 218 of file fpcompare.h.

219 {
220  CXXUTILS_FPCOMPARE_VOLATILE double va = a;
221  CXXUTILS_FPCOMPARE_VOLATILE double vb = b;
222  return va <= vb;
223 }

◆ less_equal() [2/2]

bool CxxUtils::fpcompare::less_equal ( float  a,
float  b 
)
inline

Compare two FP numbers, working around x87 precision issues.

Returns
a <= b

Definition at line 231 of file fpcompare.h.

232 {
233  CXXUTILS_FPCOMPARE_VOLATILE float va = a;
234  CXXUTILS_FPCOMPARE_VOLATILE float vb = b;
235  return va <= vb;
236 }
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
CXXUTILS_FPCOMPARE_VOLATILE
#define CXXUTILS_FPCOMPARE_VOLATILE
Definition: fpcompare.h:101