No such thing as a small change | |
PerlMonks |
Re^3: sub as mathematical functionby rsFalse (Chaplain) |
on Sep 04, 2019 at 17:06 UTC ( [id://11105615]=note: print w/replies, xml ) | Need Help?? |
>> min(int(9*$x),8)
When number of intervals vary (not only 9), then this looks more general: my $intervals = 9; min( int( $intervals * $x ), $intervals - 1 ) or: my $intervals = 9; int( $intervals * $x ) - int $x
In Section
Seekers of Perl Wisdom
|
|