I was going to say its not any type of operator, its just a visual representing of a negitive value, but infact i think mirc consideres - as a negation op higher than exponent.
Operator order of precedence should be (simplisticly)
^ : Exponentiation
- : Unary negation (unary minus)
*/ : times division
+- : add sub
I tried this...
//var %x = 2 | echo -a $calc(- %x ^ 2) | echo -a $calc(- %x * %x)
4
<incorrect>-4
<correct>In both i beleive the first %x is being negated then applied to the ^ or * operators
The first should have been %x^2 and then -, the second just comes out correctly by its nature.
While doing this i noticed something odd using the negating -
//echo -a 0-'s $calc( 1 ) | echo -a 1-'s $calc( -1 ) | echo -a 2-'s $calc( --1 ) | echo 3-'s $calc( ---1 ) | echo 4-'s $calc( ----1 ) | echo 5-'s $calc( -----1 )
0-'s 1
<correct>1-'s -1
<correct>2-'s -1
<incorrect>3-'s 1
<correct based on results on negation of 2-'s result onward>4-'s -1
<correct based on results on negation of 2-'s result onward>5-'s 1
<correct based on results on negation of 2-'s result onward>2 negates act as 1 and then extras work as there ment to negating the previous.
Oh PS: My 10 year old daughter just resolved all this by telling me that I and everyone else in this thread has no life.
