Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Normalizing a range of numbers to a percentageby choroba (Cardinal) |
on Mar 07, 2019 at 23:21 UTC ( [id://1231038]=note: print w/replies, xml ) | Need Help?? |
I remember knobs from an electric guitar that weren't linear. For such a potentiometer, you might need a different formula, but for linear ones, it seems correct.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|