The maximum notation as regards the absolute value?

747 Views Asked by At

We know that $\max(\textbf{A})$ gives the maximum element of the array $\textbf{A}$. What is the notation, or a short formula, if we seek the element having the largest absolute value? e.g., $\textbf{Blah}(-10,3)=-10$.

1

There are 1 best solutions below

0
On BEST ANSWER

Extending Regret's suggestion: \begin{equation} \text{sign}(\frac{\min A + \max A}{2})\cdot\max\{|\min A|,|\max A|\}. \end{equation} This would not work if $|\min A| = |\max A| \neq 0$, in which case Blah(.,.) wouldn't be a function anyway (unless you arbitrarily choose one of the two possible answers).