Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
get_msb.test.cpp
Go to the documentation of this file.
1
#include "
get_msb.hpp
"
2
#include <gtest/gtest.h>
3
4
using namespace
bb
;
5
6
TEST
(bitop, GetMsbUint640Value)
7
{
8
uint64_t
a
= 0b00000000000000000000000000000000;
9
EXPECT_EQ(
numeric::get_msb
(
a
), 0U);
10
}
11
12
TEST
(bitop, GetMsbUint320)
13
{
14
uint32_t
a
= 0b00000000000000000000000000000001;
15
EXPECT_EQ(
numeric::get_msb
(
a
), 0U);
16
}
17
18
TEST
(bitop, GetMsbUint3231)
19
{
20
uint32_t
a
= 0b10000000000000000000000000000001;
21
EXPECT_EQ(
numeric::get_msb
(
a
), 31U);
22
}
23
24
TEST
(bitop, GetMsbUint6463)
25
{
26
uint64_t
a
= 0b1000000000000000000000000000000100000000000000000000000000000000;
27
EXPECT_EQ(
numeric::get_msb
(
a
), 63U);
28
}
29
30
TEST
(bitop, GetMsbSizeT7)
31
{
32
size_t
a
= 0x80;
33
auto
r =
numeric::get_msb
(
a
);
34
EXPECT_EQ(r, 7U);
35
}
a
FF a
Definition
field_gt.test.cpp:51
get_msb.hpp
bb::numeric::get_msb
constexpr T get_msb(const T in)
Definition
get_msb.hpp:47
bb
Entry point for Barretenberg command-line interface.
Definition
acir_format_getters.cpp:6
bb::TEST
TEST(MegaCircuitBuilder, CopyConstructor)
Definition
mega_circuit_builder.test.cpp:14
src
barretenberg
numeric
bitop
get_msb.test.cpp
Generated by
1.9.8