From 389020e14594e4894e28d1eb9103c210b142509e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 23 May 2024 18:45:13 +0200 Subject: Adding upstream version 18.2.3. Signed-off-by: Daniel Baumann --- src/include/intarith.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include/intarith.h') diff --git a/src/include/intarith.h b/src/include/intarith.h index 68b0345a4..92f827d88 100644 --- a/src/include/intarith.h +++ b/src/include/intarith.h @@ -25,6 +25,10 @@ constexpr inline std::make_unsigned_t> div_round_up(T n return (n + d - 1) / d; } +template +constexpr inline std::make_unsigned_t> round_down_to(T n, U d) { + return n - n % d; +} template constexpr inline std::make_unsigned_t> round_up_to(T n, U d) { -- cgit v1.2.3