Description of problem: -2 squared = -4 and -2 cubed = -8 and -2 x -2 = 4 but the desktop calculator handles -2 x -2 correctly (+4), -2 squared incorrect (-4)
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. enter -2 x -2 = (ie, press minus, then 2, then times button, then minus then 2 then =)
2. enter minus 2 then the x squared button then = button
3. enter minus 2 then xy button then 2 button then = button
1. gives 4
2. give -4
3. gives -4
1. should be 4
2. should be 4
3. should be 4
it looks like x squared button and xy button handle negative numbers wrong. I put high severity because a calculator shouldn't give the wrong result to simple math problems.
I've just realised that if I put parentheses around the -2 , so that it looks like (-2) x squared then it works as expected.
I still think this is a bug because:
-2 xy 3 gives the correct -8 answer
the behaviour between
-2 x2 =
-2 xy 3 =
appears to act differently
(-2) xy 3 =
gives the same answer as
-2 xy 3 =
I think it fair to assume simple people doing simple math would expect the calculator to behave as they would expect.
I've checked lots of different software calculators and half of them get this wrong and half get this right. Several hardware calculators that I have ALL behave as I would expect. Some calculators automatically put in parentheses for you, some have a separate +- button for negative numbers which I assume is to get around this issue.
I also note that
-2**2 or -2**3 in python3 works as your calculator and gives the wrong answer and (-2)**2 and (-2)**8 works as expected so I can see what is happening here but still feel that a simple calculator program should work as simple people would expect.
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora 'version'
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.