Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>norm() calculate the square of the absolute value</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 norm()                  Calculate the Square of the Absolute Value

 #include   <complex.h>

 double norm(z);
 complex z;     Complex number.

        The norm() function is used to find the square of the absolute
        value of a complex number. norm() can overflow if the real or
        imaginary part is too large.

       Returns:     Returns the square of the absolute value.

   -------------------------------- Example ---------------------------------
        This example finds the norm of (5.9, 3.7).

        #include <complex.h>
        #include <iostream.h>

        int main(void)
        {
          double x = 5.9, y = 3.7;
          complex z = complex(x,y);
          double mag = sqrt(norm(z));
          return 0;
        }

See Also: arg() complex() polar()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson