in reply to Re: Re: Operator Precedence (unary nagation and exponentiation)
in thread Operator Precedence (unary negation and exponentiation)

Try perl -e '$v = 2; print -$v ** 2;'

This the use of unary negation that is the subject of the thread.


Examine what is said, not who speaks.

The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.

  • Comment on Re: Re: Re: Operator Precedence (unary nagation and exponentiation)
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: Re: Operator Precedence (unary nagation and exponentiation)
by tommyw (Hermit) on Jan 14, 2003 at 13:05 UTC

    But if you look at the problem that Arien posed, the answer doesn't just have the incorrect sign, it's also got the wrong magnitude.

    --
    Tommy
    Too stupid to live.
    Too stubborn to die.