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