Clarify expected operator ordering
This commit is contained in:
@@ -288,7 +288,7 @@ FL_FP::FL_FP(const FL_SP& val) : mInt(val.intVal()), mFrac(val.fracHiVal())
|
||||
{
|
||||
// Complete rounding
|
||||
|
||||
if (checkHighBit(val.fracLoVal()) & !(mInt == std::numeric_limits<uint64_t>::max() & mFrac == std::numeric_limits<uint64_t>::max()))
|
||||
if (checkHighBit(val.fracLoVal()) & !((mInt == std::numeric_limits<uint64_t>::max()) & (mFrac == std::numeric_limits<uint64_t>::max())))
|
||||
*this += FL_FP(0, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,11 +82,11 @@ public:
|
||||
|
||||
// Comparison operators (N.B. - it is faster to avoid branching using bit rather logical operators)
|
||||
|
||||
friend bool operator == (const FL_FP& a, const FL_FP& b) { return (a.mInt == b.mInt & a.mFrac == b.mFrac); }
|
||||
friend bool operator == (const FL_FP& a, const FL_FP& b) { return ((a.mInt == b.mInt) & (a.mFrac == b.mFrac)); }
|
||||
friend bool operator != (const FL_FP& a, const FL_FP& b) { return !(a == b); }
|
||||
|
||||
friend bool operator < (const FL_FP& a, const FL_FP& b) { return ((a.mInt < b.mInt) | (a.mInt == b.mInt & a.mFrac < b.mFrac)); }
|
||||
friend bool operator > (const FL_FP& a, const FL_FP& b) { return ((a.mInt > b.mInt) | (a.mInt == b.mInt & a.mFrac > b.mFrac)); }
|
||||
friend bool operator < (const FL_FP& a, const FL_FP& b) { return ((a.mInt < b.mInt) | ((a.mInt == b.mInt) & (a.mFrac < b.mFrac))); }
|
||||
friend bool operator > (const FL_FP& a, const FL_FP& b) { return ((a.mInt > b.mInt) | ((a.mInt == b.mInt) & (a.mFrac > b.mFrac))); }
|
||||
friend bool operator <= (const FL_FP& a, const FL_FP& b) { return !(a > b); }
|
||||
friend bool operator >= (const FL_FP& a, const FL_FP& b) { return !(a < b); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user