tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
idiv.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_MATH_IDIV_HPP
4
#define TETL_MATH_IDIV_HPP
5
6
#include <
etl/_concepts/integral.hpp
>
7
8
namespace
etl
{
9
10
template
<
int
egral Int>
11
struct
idiv_result
{
12
Int
quot
;
13
Int
rem
;
14
};
15
16
template
<
int
egral Int>
17
[[nodiscard]]
constexpr
auto
idiv
(Int x, Int y)
noexcept
->
idiv_result<Int>
18
{
19
return
{
static_cast<
Int
>
(x / y),
static_cast<
Int
>
(x % y)};
20
}
21
22
}
// namespace etl
23
24
#endif
// TETL_MATH_IDIV_HPP
integral.hpp
etl
Definition
adjacent_find.hpp:8
etl::idiv
constexpr auto idiv(Int x, Int y) noexcept -> idiv_result< Int >
Definition
idiv.hpp:17
etl::idiv_result
Definition
idiv.hpp:11
etl::idiv_result::quot
Int quot
Definition
idiv.hpp:12
etl::idiv_result::rem
Int rem
Definition
idiv.hpp:13
include
etl
_math
idiv.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0