I\'m kind of stuck here, I guess it\'s a bit of a brain teaser. If I have numbers in the range between 0.5 to 1 how can I normalize it to be between 0 to 1?
Thanks for a
Subtract 0.5 (giving you a new range of 0 - 0.5) then multiply by 2.
double normalize( double x ) { // I'll leave range validation up to you return (x - 0.5) * 2; }