Skip to content
Snippets Groups Projects
Commit 28656a1a authored by Thomas Schlichter's avatar Thomas Schlichter :flag_de:
Browse files

add test log2_approx.boundaries

parent d6f9bcd1
No related branches found
No related tags found
2 merge requests!3016Draft: fix tests for log2_approx and log2_approx64,!3014Integration: `2024.w40`
......@@ -16,6 +16,15 @@ TEST(log2_approx, complete)
EXPECT_EQ(log2_approx(i), log2_approx_ref(i));
}
TEST(log2_approx, boundaries)
{
for (int i = 0; i < 32; i++) {
uint32_t i2 = std::pow(2.0, i + 0.5);
EXPECT_EQ(log2_approx(i2), i) << "log2(" << i2 << ")";
EXPECT_EQ(log2_approx(i2 + 1), i + 1) << "log2(" << i2 + 1 << ")";
}
}
TEST(log2_approx64, boundaries)
{
for (int i = 0; i < 64; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment