tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
log.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_COMPLEX_LOG_HPP
4#define TETL_COMPLEX_LOG_HPP
5
6#include <etl/_cmath/log.hpp>
9#include <etl/_math/abs.hpp>
10
11namespace etl {
12
14template <typename T>
15[[nodiscard]] constexpr auto log(complex<T> const& z) noexcept -> complex<T>
16{
17 return {etl::log(etl::abs(z)), etl::arg(z)};
18}
19
20} // namespace etl
21
22#endif // TETL_COMPLEX_LOG_HPP
constexpr auto log(float v) noexcept -> float
Computes the natural (base e) logarithm of arg.
Definition log.hpp:44
constexpr auto arg(complex< T > const &z) noexcept -> T
Definition arg.hpp:15
constexpr auto abs(complex< T > const &z) -> T
Definition abs.hpp:13
Definition adjacent_find.hpp:8
A complex number.
Definition complex.hpp:19