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
10#include <type_traits>
11namespace bb::numeric {
12
23template <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
#define ASSERT_IN_CONSTEXPR(expression,...)
Definition assert.hpp:40
constexpr T ceil_div(const T &numerator, const T &denominator)
Computes the ceiling of the division of two integral types.
Definition general.hpp:23
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13