in reply to Re^2: solve cubic equations (Python)
in thread solve cubic equations

"Your code is basically the same, except that it doesn't have any dollar signs or semicolons."

Precisely why it looks more like MATHS. :)

Replies are listed 'Best First'.
Re^4: solve cubic equations (Perl & "looks like math")
by LanX (Saint) on May 04, 2017 at 23:16 UTC
    > > "Your code is basically the same, except that it doesn't have any dollar signs or semicolons."

    > Precisely why it looks more like MATHS. :)

    You don't like sigils?

    Try this

    use strict; use warnings; $,="\t"; my ($a,$b,$c); sub A() :lvalue { $a }; sub B() :lvalue { $b }; sub C() :lvalue { $c }; A = 1; B = A + 1; C = A + B; print A, B, C, B**3, sqrt(B);

    1    2    3    8    1.4142135623731

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

    A reply falls below the community's threshold of quality. You may see it by logging in.