title: Scaling a number between two values
body: <p>If I am given a floating point number but do not know beforehand what range the number will be in, is it possible to scale that number in some meaningful way to be in another range? I am thinking of checking to see if the number is in the range 0&lt;=x&lt;=1 and if not scale it to that range and then scale it to my final range. This <a href="https://stackoverflow.com/questions/1549717/scale-numbers-to-be-255">previous post</a> provides some good information, but it assumes the range of the original number is known beforehand.</p>