https://bugs.documentfoundation.org/show_bug.cgi?id=106921
Bug ID: 106921
Summary: Calculation of -$A1 to any even power (0,2,4,6,8...)
in formula comes out incorrectly positive.
Product: LibreOffice
Version: 5.2.6.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Calc
Assignee: [email protected]
Reporter: [email protected]
Description:
If I assign the value 1 to a cell, e.g. A1 and type in another cell the simple
formula: =-$A1^2 the value returned is 1, where it should be -1, as the
squaring of the cell should take precedence over the negation.
It seems that the minus (-) outside of the cell is moved into the cell before
calling the square function.
If on the other hand I type the formula as =-($A1^2), then I get the correct -1
value.
Steps to Reproduce:
1. Type the number 1 in any cell, C3 for instance
2. Go to a different cell and type the formula: =-$C3^2, or =-$C3^4 or to any
even power.
3. The result displayed will be incorrectly 1 (it should be -1)
Actual Results:
Using any number in any cell, when handled by this formula: =-$Cell^(any even
power) will give incorrectly a positive result.
As mentioned above, if the formula is instead typed as =-($Cell^2) - note the
() around the Cell - the correct result (negative) is returned.
Expected Results:
The expected result from this formula, given the above conditions, should
always be negative, as any number raised to an EVEN power becomes positive,
therefore will be turned negative due to the minus sign outside of the cell.
Reproducible: Always
User Profile Reset: Yes
Additional Info:
It seems that the minus (-) outside of the cell is moved into the cell before
calling the square function. This is not correct mathematically, as raising the
cell value to a power should take precedence over the negation of the value in
a cell.
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/57.0.2987.133 Safari/537.36
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs