tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
real.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_COMPLEX_REAL_HPP
4
#define TETL_COMPLEX_REAL_HPP
5
6
#include <
etl/_complex/complex.hpp
>
7
#include <
etl/_concepts/floating_point.hpp
>
8
#include <
etl/_concepts/integral.hpp
>
9
10
namespace
etl
{
11
13
template
<
typename
T>
14
[[nodiscard]]
constexpr
auto
real
(
complex<T>
const
& z)
noexcept
(
noexcept
(z.real())) -> T
15
{
16
return
z.real();
17
}
18
20
template
<
float
ing_po
int
Float>
21
[[nodiscard]]
constexpr
auto
real
(Float f)
noexcept
-> Float
22
{
23
return
f;
24
}
25
27
template
<
int
egral Integer>
28
[[nodiscard]]
constexpr
auto
real
(Integer i)
noexcept
->
double
29
{
30
return
static_cast<
double
>
(i);
31
}
32
33
}
// namespace etl
34
35
#endif
// TETL_COMPLEX_REAL_HPP
complex.hpp
floating_point.hpp
etl::real
constexpr auto real(complex< T > const &z) noexcept(noexcept(z.real())) -> T
Definition
real.hpp:14
integral.hpp
etl
Definition
adjacent_find.hpp:8
etl::complex
A complex number.
Definition
complex.hpp:19
include
etl
_complex
real.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0