Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
general.hpp
Go to the documentation of this file.
1
// === AUDIT STATUS ===
2
// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3
// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4
// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5
// =====================
6
7
#pragma once
8
9
#include "
barretenberg/common/assert.hpp
"
10
#include <type_traits>
11
namespace
bb::numeric
{
12
23
template
<
typename
T>
constexpr
T
ceil_div
(
const
T& numerator,
const
T& denominator)
24
{
25
ASSERT_IN_CONSTEXPR
(denominator > 0,
"Denominator must be greater than zero."
);
26
static_assert
(
std::is_integral_v<T>
,
"Type must be an integral type."
);
27
return
(numerator + denominator - 1) / denominator;
28
}
29
30
}
// namespace bb::numeric
assert.hpp
ASSERT_IN_CONSTEXPR
#define ASSERT_IN_CONSTEXPR(expression,...)
Definition
assert.hpp:40
bb::numeric
Definition
field2_declarations.hpp:12
bb::numeric::ceil_div
constexpr T ceil_div(const T &numerator, const T &denominator)
Computes the ceiling of the division of two integral types.
Definition
general.hpp:23
std::get
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition
tuple.hpp:13
src
barretenberg
numeric
general
general.hpp
Generated by
1.9.8