For example, map(x, 0, 100, 0, 1) returns 0 for x from 0 to 99, whereas one
might expect 50-100 to yield 1. This could be corrected by changing the
function's calculation to:
(x - in_min) * (out_max - out_min + 1) / (in_max - in_min + 1) + out_min
Or by clarifying the behavior and usage in the documentation (e.g. explaining
that you want to use the just past the range you're interested in).
Original issue reported on code.google.com by dmel...@gmail.com on 11 Jul 2010 at 9:22
Original issue reported on code.google.com by
dmel...@gmail.com
on 11 Jul 2010 at 9:22