Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Scriptick,
In the VBA help of "Operator Precedence", it states that Exponentiation (^) is higher than Negation (-); i.e. the opposite of Excel. In "^ Operator Example"; ........ MyValue = (-5) ^ 3 ' Returns -125. Note the barckets. So it seem you correct that Excel and VBA switch the order of precendence for these two. NickHK "Scriptick" wrote in message oups.com... Thanks, exactly what I could not find myself. However, when I repeat the calculations in the immediate window in the VBE both expressions -1^2+1 and 1-1^2 evaluate to 0. This is according to the help function ("The order in which Microsoft Excel performs operations in formulas", but then in the VBE help), but also confusing. |