Do you know where your variables are? | |
PerlMonks |
Re: sub as mathematical functionby LanX (Saint) |
on Sep 04, 2019 at 11:35 UTC ( [id://11105577]=note: print w/replies, xml ) | Need Help?? |
Provided > input: float 0 to 1 inclusive It's int(9*$v)
EditCorrected off by one
UpdatedCorrected correction ;)
UpdatedThe edge case 1=9/9 needs special treatment. Are you sure 8 is the maximum? If yes max(8,int(9*$v)) max needs to be imported. (POSIX?)
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|