On Thursday, September 18, 2014 12:00:32 PM UTC-4, Florian Oswald wrote: > > well, I guess most computer scientists would be surprised. writing on a > piece of paper > > -10^2 > > and > > -(10^2) > > I think most people are going to say the first expression is 100 and the > second is -100. I take the point that what I did was a bit stupid and Julia > is not making any mistake here. >
Note that in Fortran, Python, Matlab, and Mathematica, the exponentiation operator has higher precedence than unary -, similar to Julia. -10^2 in WolframAlpha (http://www.wolframalpha.com/input/?i=-10%5E2) gives 100, and WolframAlpha tries pretty hard to do natural-language interpretation of mathematical expressions. So, I'm not sure why computer scientists would be surprised.