![]() |
|
No such thing as a small change | |
PerlMonks |
Re^3: sub as mathematical functionby Corion (Pope) |
on Sep 04, 2019 at 11:36 UTC ( #11105578=note: print w/replies, xml ) | Need Help?? |
I linked to the documentation of the modulo operator. Your subroutine basically seems to do:
Update: No, I misread the original function. You seem to input a number with decimals and want to know into which 9-tile it falls. int ($x*9)-1, as LanX notes below, is the correct answer then.
In Section
Seekers of Perl Wisdom
|
|