Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: sub as mathematical function

by davido (Cardinal)
on Sep 04, 2019 at 18:12 UTC ( #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 (Cardinal) 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
Node Status?
node history
Node Type: note [id://11105619]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2021-04-11 13:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?