The abs() function for complex number is defined in the complex header file. This function is used to return the absolute value of the complex number z.
template<class T> T abs (const complex<T>& z);
- z: It represents the given complex number.
Return: It returns the absolute value of the complex number.
Below programs illustrate the above function:-
The absolute value of (5,12) is: 13
The absolute value of (4,3) is: 5
- sqrt() function for complex number in C++
- polar() function for complex number in C++
- cosh() function for complex number in C++
- sin() function for complex number in C++ with Examples
- Number which has the maximum number of distinct prime factors in the range M to N
- C++ Program for How to check if a given number is Fibonacci number?
- Generate a number such that the frequency of each digit is digit times the frequency in given number
- gmtime() Function in C/C++
- tellg() function in C++ with example
- nearbyint() function in C++
- imag() function in C++
- real() function in C++
- max() function for valarray in C++
- valarray swap() function in c++
- valarray size() function in C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.