Questions about discrete signal energy calculation I'm looking at the definition of signal energy (e.g. Wikipedia, cnx.org). For discrete signals, it's defined like the following, where $x(n)$ holds the signal:

$
Energy = \sum_{n=-\infty}^{\infty} |x(n)|^2
$

So my questions:


For a windowed, finite signal like double signal[256], the sum is from 1 to 256 (or 0 to 255 in a program) rather than $-\infty$ to $\infty$, right? (I don't even know how I would sum over infinity.)
Why does the energy formula have the absolute-value operator $|...|$? The result of taking the absolute value is squared anyways to produce a positive value, so taking the absolute value seems to be pointless. Is it because the $x(n)$ can be complex, so the absolute value of a complex number would be the scalar from Pythagoras' theorem?
Yes. No need to sum up an infinite number of zeros.
Yes, it is because x(n) could be complex. If we didn't take the absolute values of the complex numbers (Euclidean norm), a signal containing
$[\dots,0,0,a+ia, a-ia,0,0,\dots]$
would have an energy of zero (instead of $4a^2$) although it contains non-zero samples. For real numbers however $|a|^2 = a^2$ and the absolute value doesn't matter.