Bug Hunting Session
Bug 94624 - Cell formula =<A1>^2 result is different from =(<A1>)^2 if <A1> is negative
Summary: Cell formula =<A1>^2 result is different from =(<A1>)^2 if <A1> is negative
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: x86-64 (AMD64) All
: medium major
Assignee: Not Assigned
URL:
Whiteboard: target:5.1.0 target:5.0.4
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-29 19:29 UTC by Alexander Polkhovskiy
Modified: 2016-10-25 19:20 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example table with bug (10.06 KB, application/vnd.oasis.opendocument.text)
2015-09-29 19:29 UTC, Alexander Polkhovskiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Polkhovskiy 2015-09-29 19:29:09 UTC
Created attachment 119122 [details]
Example table with bug

Make a table of 3 cells in a row.
Put any negative number in A1 cell.
Type in the following formula in B1 cell: =<A1>^2
You get negative result. However, any even power should be positive whanever the parameter is.
Type in the following formula in C1 cell: =(<A1>)^2
Now you get what you expect - positive square power of A1.
I know about bug in operations order in Calc and Excel, but in Writer I don't have minus sign directly in the cell formula.
Comment 1 Terrence Enger 2015-09-30 02:05:32 UTC
Thank you, Alexander, for helping us to improve LibreOffice.

I see the bug on Linux in both daily dbgutil bibisect version
2015-09-28 and version 3.5.4.2 as distributed with debian wheezy.

I am setting status NEW, o/s All, version 3.5.4, and priority Major.

Terry.
Comment 2 Commit Notification 2015-11-06 14:26:18 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0bd2a5eedd91466f97806e198b125546d256d1f8

tdf#94624 calculation of power operator fixed

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2015-11-09 20:52:09 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=74d6d268e9a7193dcca39bbfad2830a2504dfe79&h=libreoffice-5-0

tdf#94624 calculation of power operator fixed

It will be available in 5.0.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Alexander Polkhovskiy 2015-12-21 09:26:51 UTC
Works fine now. Thank you!
LO v 5.0.4.2
Windows 8.1 x64
Comment 5 Terrence Enger 2015-12-21 16:24:17 UTC
In accord with comment 4 and my experiment with daily dbgutil bibisect
version 2915-12-21, I am setting status RESOLVED FIXED.

Thank you, Oliver.