mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-07 06:04:27 +02:00
Move pi_to_the
to the test file
This commit is contained in:
@@ -259,12 +259,6 @@ struct pi_base {
|
|||||||
static constexpr long double value = std::numbers::pi_v<long double>;
|
static constexpr long double value = std::numbers::pi_v<long double>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A simple way to create a Magnitude representing a rational power of pi.
|
|
||||||
*/
|
|
||||||
template<ratio Power>
|
|
||||||
constexpr auto pi_to_the() { return magnitude<base_power<pi_base>{Power}>{}; }
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Magnitude equality implementation.
|
// Magnitude equality implementation.
|
||||||
|
|
||||||
|
@@ -34,6 +34,9 @@ struct other_noncanonical_two_base { static constexpr long double value = 2.0L;
|
|||||||
struct invalid_zero_base { static constexpr long double value = 0.0L; };
|
struct invalid_zero_base { static constexpr long double value = 0.0L; };
|
||||||
struct invalid_negative_base { static constexpr long double value = -1.234L; };
|
struct invalid_negative_base { static constexpr long double value = -1.234L; };
|
||||||
|
|
||||||
|
template<ratio Power>
|
||||||
|
constexpr auto pi_to_the() { return magnitude<base_power<pi_base>{Power}>{}; }
|
||||||
|
|
||||||
TEST_CASE("base_power")
|
TEST_CASE("base_power")
|
||||||
{
|
{
|
||||||
SECTION("base rep deducible for integral base")
|
SECTION("base rep deducible for integral base")
|
||||||
|
Reference in New Issue
Block a user