Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: sub as mathematical function

by davido (Cardinal)
on Sep 04, 2019 at 18:12 UTC ( [id://11105619]=note: print w/replies, xml ) Need Help??


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

The subexpression 9*X/18 == (9x)/18 == x/2. Therefore, max(min(int($_ / 2), 8, 0);


Dave

Replies are listed 'Best First'.
Re^5: sub as mathematical function
by LanX (Saint) on Sep 04, 2019 at 21:15 UTC
    The core of the formula was 9*$v I was just trying to cover all edges cases for $v in a one liner.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-20 00:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found