This should be an easy one.
I have a list of numbers. How do I scale list's values, between -1.0
and 1.0
in order for min = -1
and max = 1.0
?
Find the min and the max
then for each number scale x
to 2 * (x - min)/( max - min) - 1
Just to check --
If it is a long list precomputing c = 2/(max - min)
and scaling with c * x - 1
is a good idea.