Only test pi if float is smaller than long double

This commit is contained in:
Chip Hogg
2022-01-28 20:44:29 +00:00
parent 243238b3fa
commit 2384276ae0

View File

@@ -163,6 +163,7 @@ TEST_CASE("magnitude converts to numerical value")
SECTION("pi to arbitrary power performs computations in most accurate type at compile time")
{
if constexpr (sizeof(float) < sizeof(long double)) {
constexpr auto pi_cubed = pi_to_the<3>();
auto cube = [](auto x) { return x * x * x; };
@@ -173,6 +174,7 @@ TEST_CASE("magnitude converts to numerical value")
REQUIRE(pi_cubed_value != via_float);
CHECK(pi_cubed_value == via_long_double);
}
}
SECTION("Impossible requests are prevented at compile time")
{