Skip to content

Commit a673fd2

Browse files
authored
Merge pull request #744 from HazardyKnusperkeks/wfloat
Supress some -Wfloat warnings
2 parents a0fd724 + ee6ac96 commit a673fd2

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/core/include/mp-units/bits/constexpr_math.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ template<typename T>
117117
return std::nullopt;
118118
}
119119

120+
MP_UNITS_DIAGNOSTIC_PUSH
121+
MP_UNITS_DIAGNOSTIC_IGNORE_FLOAT_EQUAL
120122
// Handle special cases of zero and one.
121123
if (x == 0 || x == 1) {
122124
return x;
@@ -172,6 +174,7 @@ template<typename T>
172174
hi = mid;
173175
}
174176
}
177+
MP_UNITS_DIAGNOSTIC_POP
175178

176179
// Pick whichever one gets closer to the target.
177180
const auto lo_diff = xld - checked_int_pow(lo, n).value();

src/core/include/mp-units/framework/quantity.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,10 @@ class quantity {
622622
using ct = std::common_type_t<quantity, quantity<R2, Rep2>>;
623623
const ct ct_lhs(lhs);
624624
const ct ct_rhs(rhs);
625+
MP_UNITS_DIAGNOSTIC_PUSH
626+
MP_UNITS_DIAGNOSTIC_IGNORE_FLOAT_EQUAL
625627
return ct_lhs.numerical_value_ref_in(ct::unit) == ct_rhs.numerical_value_ref_in(ct::unit);
628+
MP_UNITS_DIAGNOSTIC_PUSH
626629
}
627630

628631
template<std::derived_from<quantity> Q, RepresentationOf<quantity_spec> Value>

0 commit comments

Comments
 (0)