29 Aug
2001
29 Aug
'01
5:54 p.m.
"Marcin 'Qrczak' Kowalczyk" <qrczak@knm.org.pl> writes:
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.
I agree that many languages got it wrong :-)
many languages have it the haskell way: -9: perl, ruby, python, haskell 9: ocaml
In mathematics the prefix negation is handled like in Haskell:
2 -3 = -9
-3^2 = -9 doesn't bother me -3 ^ 2 = -9 do bother me :-(