Prev | Next |
y = abs(x)
y
equal to the absolute value of
x
.
x
can be an instance of float
,
an a_float
, an a2float
, or an numpy.array
of such objects.
x
is an instance of float
,
y
will also be an instance of
float
.
Otherwise
y
will have the same type as
x
.
In the case where
x
is an array,
y
will
the same shape as
x
and the elements of
y
will have the same type as the elements of
x
.
\[
\R{abs}^{(1)} (x) = \R{sign} (x) = \left\{ \begin{array}{ll}
1 & \R{if} \; x > 0
\\
0 & \R{if} \; x = 0
\\
-1 & \R{if} \; x < 0
\end{array} \right.
\]
\[
\R{abs}^\circ ( x , d ) = \lim_{\lambda \downarrow 0 }
\frac{\R{abs}(x + \lambda d) - \R{abs}(x) }{ \lambda }
\]
For
x \neq 0
,
\[
\R{abs}^\circ ( x , d ) = \R{abs}^{(1)} ( x ) * d
\]
and
\R{abs}^\circ (0 , d) = |d|
.