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
7
8namespace etl {
9
10template <integral Int>
12 Int quot;
13 Int rem;
14};
15
16template <integral 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
Definition adjacent_find.hpp:8
constexpr auto idiv(Int x, Int y) noexcept -> idiv_result< Int >
Definition idiv.hpp:17
Definition idiv.hpp:11
Int quot
Definition idiv.hpp:12
Int rem
Definition idiv.hpp:13