No.
my $x = (($tap - $min) * ($new_max - $new_min) / ($max - $min)) + $new +_min;
The offset on the new range has to be outside the multiply.
In reply to Re^5: Normalizing a range of numbers to a percentage
by tybalt89
in thread Normalizing a range of numbers to a percentage
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |