Detect Zero Vector

By Xah Lee. Date: .

What is the most efficient or elegant way to detect zero vector of n dimensions (list whose element are all 0)?

Answer: probably compute the sum of squares. e.g. (Total[#^2] == 0 &)

For example, here's a function for geometric inversion.

geoInv = ((With[{x = Total[#^2]}, If[ x < 0.00000001 ,#,#/x] ]) &);