From 17d6a993fc17d533460c5f40f3908c708e057c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 23 May 2024 18:45:17 +0200 Subject: Merging 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