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