ATLAS Offline Software
Loading...
Searching...
No Matches
CxxUtils::fpcompare Namespace Reference

Functions

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

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}
static Double_t a
#define CXXUTILS_FPCOMPARE_VOLATILE
Definition fpcompare.h:101

◆ 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{
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{
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{
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{
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{
234 CXXUTILS_FPCOMPARE_VOLATILE float vb = b;
235 return va <= vb;
236}