mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Smoke test for std::round and std::lround
Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
committed by
Konstantin Pastbin
parent
972cefb074
commit
ae349462c6
@@ -45,6 +45,19 @@ void TestMaxULPs()
|
|||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
UNIT_TEST(round_lround_smoke)
|
||||||
|
{
|
||||||
|
TEST_EQUAL(std::round(0.4), 0.0, ());
|
||||||
|
TEST_EQUAL(std::round(0.6), 1.0, ());
|
||||||
|
TEST_EQUAL(std::round(-0.4), 0.0, ());
|
||||||
|
TEST_EQUAL(std::round(-0.6), -1.0, ());
|
||||||
|
|
||||||
|
TEST_EQUAL(std::lround(0.4), 0l, ());
|
||||||
|
TEST_EQUAL(std::lround(0.6), 1l, ());
|
||||||
|
TEST_EQUAL(std::lround(-0.4), 0l, ());
|
||||||
|
TEST_EQUAL(std::lround(-0.6), -1l, ());
|
||||||
|
}
|
||||||
|
|
||||||
UNIT_TEST(PowUInt)
|
UNIT_TEST(PowUInt)
|
||||||
{
|
{
|
||||||
TEST_EQUAL(PowUint(3, 10), 59049, ());
|
TEST_EQUAL(PowUint(3, 10), 59049, ());
|
||||||
|
|||||||
Reference in New Issue
Block a user