forked from mpusz/mp-units
Feat: Overloads for floor and ceil accepting quantities (#314)
* feat: overloads for floor and ceil accepting quantities * require same type for dim and rep * be specific for msvc
This commit is contained in:
@@ -148,6 +148,10 @@ TEST_CASE("floor functions", "[floor]")
|
||||
SECTION ("floor -999. milliseconds with target unit second should be -1 second") {
|
||||
REQUIRE(floor<si::second>(-999._q_ms) == -1_q_s);
|
||||
}
|
||||
SECTION ("floor 1 second with target quantity with unit type second should be 1 second") {
|
||||
using showtime = si::time<si::second, int>;
|
||||
REQUIRE(floor<showtime>(showtime::one()) == showtime::one());
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("ceil functions", "[ceil]")
|
||||
@@ -189,6 +193,10 @@ TEST_CASE("ceil functions", "[ceil]")
|
||||
SECTION ("ceil -999. milliseconds with target unit second should be 0 seconds") {
|
||||
REQUIRE(ceil<si::second>(-999._q_ms) == 0_q_s);
|
||||
}
|
||||
SECTION ("ceil 1 second with target quantity with unit type second should be 1 second") {
|
||||
using showtime = si::time<si::second, int>;
|
||||
REQUIRE(ceil<showtime>(showtime::one()) == showtime::one());
|
||||
}
|
||||
}
|
||||
|
||||
TEMPLATE_TEST_CASE_SIG("pow<N>() implementation exponentiates values to power N", "[math][pow][exp]",
|
||||
|
||||
Reference in New Issue
Block a user