I have a large list of numeric (decimal) values ranging from approximately [-2, 2] with some of them being equal to 0 and I need to scale them so that their sum is equal to 0 while keeping their sign (i.e. negative numbers must remain negative after scaling).
The first try was to divide each number by the sum of all numbers in the list, at which point the sum of those is 1 then subtract $\frac{1}{c}$ where $c$ is the number of elements in the list but that has the drawback of not respecting the sign for values that are close to 0 to begin with.
Anyone has any tips on the best way to achieve this? Thanks