tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
abs.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_COMPLEX_ABS_HPP
4
#define TETL_COMPLEX_ABS_HPP
5
6
#include <
etl/_cmath/hypot.hpp
>
7
#include <
etl/_complex/complex.hpp
>
8
9
namespace
etl
{
10
12
template
<
typename
T>
13
[[nodiscard]]
constexpr
auto
abs
(
complex<T>
const
& z) -> T
14
{
15
return
hypot
(z.real(), z.imag());
16
}
17
18
}
// namespace etl
19
20
#endif
// TETL_COMPLEX_ABS_HPP
complex.hpp
etl::hypot
constexpr auto hypot(float x, float y) noexcept -> float
Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at...
Definition
hypot.hpp:57
etl::abs
constexpr auto abs(complex< T > const &z) -> T
Definition
abs.hpp:13
hypot.hpp
etl
Definition
adjacent_find.hpp:8
etl::complex
A complex number.
Definition
complex.hpp:19
include
etl
_complex
abs.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0