
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
log10() function for complex number in C++
In this article we will be discussing the working, syntax and examples of log10() function in C++ STL.
What is log10() function?
log10() function is an inbuilt function in C++ STL, which is defined in <complex> header file. log10() is used to find the common logarithmic value of a complex number. This function returns the common complex log value with base 10 of a complex number num.
Syntax
template<class T> complex<T> log10(const complex<T>& num);
Parameters
This function accepts one parameter num, which is a complex value whose log we have to find.
Return value
The common complex log value of num we want to calculate.
Example
Input: complex<double> C_number(-4.0, -1.0); Log10(C_number); Output: log10 of (-4,-1) is (0.615224,-1.25798)
Example
#include <bits/stdc++.h> using namespace std; int main() { complex<double> C_number(-4.0, -1.0); cout<<"log10 of "<< C_number<< " is "<<log10(C_number); return 0; }
Output
If we run the above code it will generate the following output −
log10 of (-4,-1) is (0.615224,-1.25798)
Example
#include <bits/stdc++.h> using namespace std; int main() { complex<double> C_number(-4.0, 1.0); cout<<"log10 of "<< C_number<< " is "<<log10(C_number); return 0; }
Output
If we run the above code it will generate the following output −
log10 of (-4,1) is (0.615224,1.25798)
- Related Articles
- arg() function for Complex Number in C++
- abs() function for complex number in c++ ?
- acosh() function for complex number in C++
- acos() function for complex number in C++?
- asin() function for complex number in C++?
- atan() function for complex number in C++?
- tanh( ) function for complex Number in C++
- log() function for complex number in C++
- tan() function for complex number in C++
- Cos() function for complex number in C++
- pow() function for complex number in C++
- polar() function for complex number in C++
- exp() function for complex number in C++
- sqrt ( ) function for complex number in C++
- Sinh( ) function for complex number in C++

Advertisements