two's complement conversion
Just having a brain fade....
I'm looking for the quick and easy way of converting an array index (range variable), e.g 0...255, into it's two's complement equivalent i.e. 0...127;-128...-1.
This is for the FFT function (also applicable in many other places) so that I can pre-calculate some frequency spectra.
Alternatively, treat this as a suggestion that there should be a built in two's complement function, almost the same format as mod, whereby twoscomp(a,n) returns mod(a,n), or mod(a,n)-n if mod(a,n)>=n/2.
It would be good to have this as a standard function. Plus suggestions for the best name [two-scomp .v. twos-comp]
Philip
PS Having had to think as I write, I suppose I'll just have to declare a function tc(a,n) as above.

