std::log10(std::complex)(3)
Hey bestie π this is the std::log10(std::complex)(3) page from the C++ Standard Libary manual β and no, we are not gatekeeping complex log math today.
π NAME π
std::log10(std::complex) β std::log10(std::complex). That's the whole NAME line, and honestly it's giving self-titled debut album π
.
πΈ Synopsis πΈ
Defined in header <complex>
template< class T >
std::complex<T> log10( const std::complex<T>& z );
Okay so this template computes the complex common (base 10) logarithm of a complex value z with a branch cut along the negative real axis. The behavior of this function is equivalent to std::log(z) / std::log(T(10)). That's the tea ββ¨.
π Parameters π
zβ complex value.
π¦ Return value π¦
Complex common logarithm of z. That's it, that's the return value, periodt π«Ά.
β¨ Example β¨
Run this code, bestie:
// Run this code
#include <cmath>
#include <complex>
#include <iostream>
int main()
{
std::complex<double> z(0.0, 1.0); // r = 0, ΞΈ = pi / 2
std::cout << "2 * log10" << z << " = " << 2.0 * std::log10(z) << '\n';
std::complex<double> z2(sqrt(2.0) / 2, sqrt(2.0) / 2); // r = 1, ΞΈ = pi / 4
std::cout << "4 * log10" << z2 << " = " << 4.0 * std::log10(z2) << '\n';
std::complex<double> z3(-100.0, 0.0); // r = 100, ΞΈ = pi
std::cout << "log10" << z3 << " = " << std::log10(z3) << '\n';
std::complex<double> z4(-100.0, -0.0); // the other side of the cut
std::cout << "log10" << z4 << " = " << std::log10(z4) << " "
"(the other side of the cut)\n"
"(note: pi / log(10) = " << std::acos(-1.0) / std::log(10.0) << ")\n";
}
π₯ Possible output π₯
2 * log10(0,1) = (0,1.36438)
4 * log10(0.707107,0.707107) = (0,1.36438)
log10(-100,0) = (2,1.36438)
log10(-100,-0) = (2,-1.36438) (the other side of the cut)
(note: pi / log(10) = 1.36438)
π See also π
log(std::complex)β complex natural logarithm with the branch cuts along the negative real axis (function template).log10,log10f,log10lβ computes common (base 10) logarithm (\({\small\log_{10}{x}}\)log[10](x)) (function). The original table has(C++11)and(C++11)here, and we are keeping both, no cap π«Ά.log10(std::valarray)β applies the functionstd::log10to each element ofvalarray(function template).
Okay that's the whole vibe, bestie π«Ά source: http://cppreference.com; version/date: 2024.06.10. Go log some complex numbers and slay π
β¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms