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// SPDX-FileCopyrightText: Copyright (C) 2023 Tobias Hienzsch
3
4#ifndef TETL_COMPLEX_LOG_HPP
5#define TETL_COMPLEX_LOG_HPP
6
7#include <etl/_cmath/log.hpp>
8#include <etl/_complex/arg.hpp>
9#include <etl/_complex/complex.hpp>
10#include <etl/_math/abs.hpp>
11
12namespace etl {
13
14/// \ingroup complex
15template <typename T>
16[[nodiscard]] constexpr auto log(complex<T> const& z) noexcept -> complex<T>
17{
18 return {etl::log(etl::abs(z)), etl::arg(z)};
19}
20
21} // namespace etl
22
23#endif // TETL_COMPLEX_LOG_HPP
constexpr auto log(complex< T > const &z) noexcept -> complex< T >
Definition log.hpp:16
Definition adjacent_find.hpp:9
A complex number.
Definition complex.hpp:20