Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: sub as mathematical function

by rsFalse (Hermit)
on Sep 04, 2019 at 17:06 UTC ( #11105615=note: print w/replies, xml ) Need Help??


in reply to Re^2: sub as mathematical function
in thread sub as mathematical function

>> 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11105615]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2020-01-24 03:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?