Magnitude R←|Y

Y may be any numeric array. R is numeric composed of the absolute (unsigned) values of Y.

Note that the magnitude of a complex number z = a + b i (where a and b are real numbers, and i is the imaginary unit) is defined to be:

| z | = a 2 + b 2

Examples

      |2 ¯3.4 0 ¯2.7
2 3.4 0 2.7

      |3j4
5

⎕IO is an implicit argument of magnitude.