So if I have a range of numbers \'0 - 1024\' and I want to bring them into \'0 - 255\', the maths would dictate to divide the input by the maximum the input will be (1024 in
You should auto-cast n to float by means of a multiplication FIRST, otherwise you're doing an integer operation and then casting the result, instead of doing the operation between floats.