Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
If signs aren't a big deal, use the generalized mean formula
$$ \left(\frac{1}{n}\sum x_i^n\right)^{1/n} $$$$ \left(\frac{1}{n}\sum x_i^k\right)^{1/k} $$
for $n\to -\infty$$k\to -\infty$.
$$ \left(\frac{1}{n}\sum x_i^n\right)^{1/n} $$
for $n\to -\infty$.
$$ \left(\frac{1}{n}\sum x_i^k\right)^{1/k} $$
for $k\to -\infty$.