"With $new_min = 5, it would give a range of 0..95 rather than 5..100 if you don't include the offset."
So the following is what is meant here?
my $x = (($tap - $min) * ($new_max - $new_min + 5) / ($max - $min)); # ^^^
In reply to Re^4: Normalizing a range of numbers to a percentage
by stevieb
in thread Normalizing a range of numbers to a percentage
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |