View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Joe User[_2_] Joe User[_2_] is offline
external usenet poster
 
Posts: 905
Default Customizing -2^2

"Tim Walters" wrote:
Is there a way to customize this in Excel so that
-2^2 = -4?


No, at least not in Excel 2003. Operator precedence is not configurable.


Shouldn't minus a squared number be a minus number?


Arguing about the correctness (or not) of operator precedence among computer
languages is like arguing about the correctness of the order of
adverbial/verb and adjective/noun among natural languages. At least one
computer language eschewed operator precedence rules altogether. Whose to
say that is wrong?

When you learn a natural language, you learn its peculiar grammar rules as
well as its vocabulary. Similarly with computer languages and applications
like Excel that have a significant language for expressing things.

It is fair to say that Excel's precedence order between unary negation and
exponentiation is different from conventional mathematics. That is neither
"right" nor "wrong". Arguably, it would be "wrong" if Excel was marketed as
a language for expressing mathematics. But I do not believe MS has never
made that claim. (Obviously they shouldn't.)

As far as compatibility among spreadsheet products, Excel's
backward-compatibility models are Multiplan, Lotus and Visicalc, probably in
that order. Those were the market leaders of their day.

A human user must make appropriate adjustments when moving from one product
to another similar product. MS Word is very different from WordPerfect.
Likewise, Excel is different from Quattro Pro, albeit perhaps not quite as
dissimilar in some respects.

However, a QuattroPro-to-Excel converter should handle the differences
appropriately. In particular, the Quattro Pro formula -2^2 should be
converted to the Excel formula -(2^2) or -POWER(2,2). If it is not, that is
a defect in the converter, not a flaw in Excel operator precedence.


----- original message -----

"Tim Walters" wrote in message
...
Shouldn't minus a squared number be a minus number? In Excel -2^2 = 4. To
keep it negative I have to write -(2^2). It's very easy to make mistakes
because I also work with Quattro Pro which works differently. Is there a
way to customize this in Excel so that -2^2 = -4?

Thanks.