tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
ratio_add.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_RATIO_ADD_HPP
5#define TETL_RATIO_ADD_HPP
6
7#include <etl/_ratio/ratio.hpp>
8
9namespace etl {
10
11/// \brief The alias template ratio_add denotes the result of adding two
12/// exact rational fractions represented by the ratio specializations R1
13/// and R2.
14/// \ingroup ratio
15template <typename R1, typename R2>
16using ratio_add = ratio<R1::num * R2::den + R2::num * R1::den, R1::den * R2::den>;
17
18} // namespace etl
19
20#endif // TETL_RATIO_ADD_HPP
Definition adjacent_find.hpp:9
The typename template provides compile-time rational arithmetic support. Each instantiation of this t...
Definition ratio.hpp:22