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
8
9namespace etl {
10
12template <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
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
constexpr auto abs(complex< T > const &z) -> T
Definition abs.hpp:13
Definition adjacent_find.hpp:8
A complex number.
Definition complex.hpp:19