Abs(
x
)
Returns the absolute value of a number, or the modulus for complex numbers.
For real numbers:
|
x
|
=
x
if
x
≥
0
−
x
if
x
<
0
For complex numbers:
|
x
|
=
r
2
+
i
2
Example
=
Block
{
ShowAbs
(
-
3);
ShowAbs
(5);
ShowAbs
(3
+
2
Math
.
I
);
};
The absolute value of -3 is 3.
The absolute value of 5 is 5.
The absolute value of 3
+
2
i
is
13
.