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
- Maximum number of 3-person teams formed from two groups
- C/C++ Program for n-th Fibonacci number
- Greatest divisor which divides all natural number in range [L, R]
- C++ Program for How to check if a given number is Fibonacci number?
- C++ Program for Largest K digit number divisible by X
- C++ Program for Smallest K digit number divisible by X
- Print Number series without using any loop
- Number of stopping station problem
- C++ program to generate random number
- C++ Program to find sum of even factors of a number
- Print the pyramid pattern with given height and minimum number of stars
- Check if given number is perfect square
- Program to delete a line given the line number from a file
- Count the number of 1's and 0's in a binary array using STL in C++ ?
- First element that appears even number of times in an array
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.