Prefix negation

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
29 Aug 2001 16:01:33 GMT


Wed, 29 Aug 2001 16:34:52 +0200, Rijk-Jan van Haaften <rjchaaft@cs.uu.nl> pisze:

> -3 ^ 2 = -9
> 
> In most programming languages as well as in mathematics
> it is quite unusual to have infix operators with a higher
> priority than prefix operators.

In mathematics the prefix negation is handled like in Haskell:

      2
    -3  = -9

I agree that many languages got it wrong :-)

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK