Order of operations

BlitzMax Forums/BlitzMax Programming/Order of operations

Curtastic(Posted 2007) [#1]
Shouldn't these print the same thing? Mathematically they are equal.

Print 0-3^2
Print -3^2



TaskMaster(Posted 2007) [#2]
I think...

The first one says 3 to the power of 2, subtracted from zero. Which equals -9.

The second one says negative 3 to the power of 2. Which is 9.


Grey Alien(Posted 2007) [#3]
Agreed try Print -(3^2)


Czar Flavius(Posted 2007) [#4]
You could have told us the results you were getting in your post.