We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55196f1 commit 292d6daCopy full SHA for 292d6da
libopenage/util/fixed_point.h
@@ -464,7 +464,9 @@ class FixedPoint {
464
}
465
466
// Check for negative values
467
- ENSURE(std::is_unsigned<raw_type>() or (std::is_signed<raw_type>() and this->raw_value > 0), "FixedPoint::sqrt() is undefined for negative values.");
+ if constexpr (std::is_signed<raw_type>()) {
468
+ ENSURE(this->raw_value > 0, "FixedPoint::sqrt() is undefined for negative values.");
469
+ }
470
471
// A greater shift = more precision, but can overflow the intermediate type if too large.
472
size_t max_shift = std::countl_zero(static_cast<unsigned_intermediate_type>(this->raw_value)) - 1;
0 commit comments