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<=x<=1 and if not scale it to that range and then scale it to my final range. This previous post provides some good information, but it assumes the range of the original number is known beforehand.
Share
You can’t scale a number in a range if you don’t know the range.
Maybe what you’re looking for is the modulo operator. Modulo is basically the remainder of division, the operator in most languages is is
%.