Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
count_leading_zeros.test.cpp
Go to the documentation of this file.
2#include <gtest/gtest.h>
3
4using namespace bb;
5
6TEST(bitop, ClzUint3231)
7{
8 uint32_t a = 0b00000000000000000000000000000001;
9 EXPECT_EQ(numeric::count_leading_zeros(a), 31U);
10}
11
12TEST(bitop, ClzUint320)
13{
14 uint32_t a = 0b10000000000000000000000000000001;
15 EXPECT_EQ(numeric::count_leading_zeros(a), 0U);
16}
17
18TEST(bitop, ClzUint640)
19{
20 uint64_t a = 0b1000000000000000000000000000000100000000000000000000000000000000;
21 EXPECT_EQ(numeric::count_leading_zeros(a), 0U);
22}
23
24TEST(bitop, ClzUint256255)
25{
26 uint256_t a = 0x1;
28 EXPECT_EQ(r, 255U);
29}
30
31TEST(bitop, ClzUint256248)
32{
33 uint256_t a = 0x80;
35 EXPECT_EQ(r, 248U);
36}
FF a
constexpr size_t count_leading_zeros(T const &u)
Entry point for Barretenberg command-line interface.
TEST(MegaCircuitBuilder, CopyConstructor)