mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-07 14:14:27 +02:00
Only test pi if float is smaller than long double
This commit is contained in:
@@ -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")
|
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>();
|
constexpr auto pi_cubed = pi_to_the<3>();
|
||||||
|
|
||||||
auto cube = [](auto x) { return x * x * x; };
|
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);
|
REQUIRE(pi_cubed_value != via_float);
|
||||||
CHECK(pi_cubed_value == via_long_double);
|
CHECK(pi_cubed_value == via_long_double);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SECTION("Impossible requests are prevented at compile time")
|
SECTION("Impossible requests are prevented at compile time")
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user