std:: log10 (std::complex)
From cppreference.net
C++
Numerics library
| Common mathematical functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical special functions (C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical constants (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic linear algebra algorithms (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data-parallel types (SIMD) (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Floating-point environment (C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Complex numbers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numeric array (
valarray
)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pseudo-random number generation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bit manipulation (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Saturation arithmetic (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C-style checked integer arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::complex
|
Défini dans l'en-tête
<complex>
|
||
|
template
<
class
T
>
std:: complex < T > log10 ( const std:: complex < T > & z ) ; |
||
Calcule le logarithme commun complexe (base 10 ) d'une valeur complexe z avec une coupure de branche le long de l'axe réel négatif.
Le comportement de cette fonction est équivalent à
std::log
(z) /
std::log
(T(10))
.
Table des matières |
Paramètres
| z | - | valeur complexe |
Valeur de retour
Logarithme commun complexe de z .
Exemple
Exécuter ce 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"; }
Sortie possible :
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)
Voir aussi
|
logarithme naturel complexe avec les coupures de branche le long de l'axe réel négatif
(modèle de fonction) |
|
|
(C++11)
(C++11)
|
calcule le logarithme commun (base
10
) (
\({\small\log_{10}{x}}\)
log
10
(x)
)
(fonction) |
|
applique la fonction
std::log10
à chaque élément du valarray
(modèle de fonction) |