Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: sub as mathematical function

by rsFalse (Chaplain)
on Sep 04, 2019 at 17:06 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11105615]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2024-04-23 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found