# OASIS: Infix Operator "^"

• From: Leonard Mada <discoleo gmx net>
• To: gnumeric-list gnome org, office-comment lists oasis-open org
• Subject: OASIS: Infix Operator "^"
• Date: Thu, 22 Feb 2007 21:09:57 +0200

Chapter 6.3.5 of the OASIS OpenFormula document (version 2007-02-14) describes the Infix Operator (^).
```
However, it contains a lot of mathematical ERRORS:

1. “^” is left-associative, not right-associative!!!
```
Therefore: =2^3^2 should return =2^(3^2) = 512 and NOT 64 !!! The second "^" left associates with "3", so first "3" gets squared and thereafter the first "2" gets to the power 9.
```
2. The classic ERROR: -4^2
Mathematically, this yields always -(4^2)=-16, NEVER +16!!!
```
There is NO unary operator in mathematics that converts a number to its negative, like described in the documents. I would suggest consulting a dedicated mathematical program. As stated in issue http://www.openoffice.org/issues/show_bug.cgi?id=66735 on the OOo website:
```*Mathematica* v5.(x) returns -16
*R* v2.4.0 returns -16
```
other software (like Scilab, maxima, octave, as pointed in that Calc issue) report -16, too.
```
```
gnumeric takes an interesting approach: it converts the first expression to =(-4)^2, which indeed is then +16. So, this last is mathematically correct and, at the same time, users who know a bit more about mathematics, recognize that gnumeric did NOT calculated what they expected. (it is transparent what has happened)
```
```
Stating however, that -4^2 = +16 is plain wrong!!! And inventing various mathematical rules that break the old ones is really NOT good for a standard.
```
I hope this gets corrected.

Kind regards,