Bug 114922 - Calc misinterprets order of mathematical operations
Summary: Calc misinterprets order of mathematical operations
Status: RESOLVED DUPLICATE of bug 37271
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
Depends on:
Reported: 2018-01-09 07:46 UTC by Karel Hruska
Modified: 2020-08-31 12:05 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Karel Hruska 2018-01-09 07:46:07 UTC
Bad calculation of exponents, x^n provides the same result as -x^n.

Steps to Reproduce:
1. Put a number into a cell in LO Calc, e.g. "6" in cell A1.
2. In another cell, try to calculate relation "=-A1^2".
3. The result should be -36, LO Calc gives 36.

Actual Results:  
The LO Calc calculates the relation as if parentheses were present, for -A1^2, where A1=6 it gives 36, which is incorrect.

Expected Results:
It is expected to first process the power operation, then addition of sign.

Reproducible: Always

User Profile Reset: Yes

OpenGL enabled: Yes

Additional Info:
See these relations, they are not the same, yet LO processes them identically:

1. -x^n
2. (-x)^n

The first expression should be processed as -(x^n), not as the second one. Just check the same relations in e.g. GNU/Octave.

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36
Comment 1 Aron Budea 2018-01-09 10:01:20 UTC
Please see bug 37271.

*** This bug has been marked as a duplicate of bug 37271 ***