[calculator-app]Correction needed in calculation

Reported by Mihir Soni on 2013-09-17
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Calculator App
High
Mihir Soni
Ubuntu UX
Undecided
Christina Li

Bug Description

It's not giving the correct output of the calculation with the following calculation :-

Steps :-

Start a new calculation
Press 9
Press *
Press 9
Press -
Press (=)

Result should be 81 , currently it shows 72.

Related branches

lp:~mihirsoni/ubuntu-calculator-app/1226738
Merged into lp:ubuntu-calculator-app at revision 165
Riccardo Padovani: Approve on 2013-09-28
Ubuntu Phone Apps Jenkins Bot: Approve (continuous-integration) on 2013-09-27
Riccardo Padovani (rpadovani) wrote :

It's desidered behavior, if you press equal after a sign, first number before sign is used.
See https://bugs.launchpad.net/ubuntu-calculator-app/+bug/1203435

Changed in ubuntu-calculator-app:
status: New → Invalid
Mihir Soni (mihirsoni) wrote :

But how come its 72 ??

Riccardo Padovani (rpadovani) wrote :

Because
9*9-= is equal to 9*9-9, that is 72 ;)

Sam Bull (dreamsorcerer) wrote :

OK, I see two problems with this.

Firstly, the obvious one. If you do keep it behaving like this (despite no other calculator using this behaviour), then the output is wrong. Entering the above into the calculator actually displays the calculation as:

   9
+ 9
- 0
= 72

Which is clearly wrong. If you're going to implicitly add numbers to the calculation, you need to actually display them.

Secondly, this behaviour makes little sense to me. I would expect that after entering an operand such as '+', if I then hit a different operand like 'x' it would change the operand, because I've just changed my mind. I would then expect '=' to work as an operand in the same way, thus removing any trailing operand because I've just changed my mind.

For comparison, entering the above into gnome-calculator gives a 'malformed expression' and into Android's calculator, gives 81.

It's probably worth getting some designer input on the second point.

Changed in ubuntu-calculator-app:
status: Invalid → Confirmed
Riccardo Padovani (rpadovani) wrote :

Ok, we'll wait an input from design team.

Changed in ubuntu-calculator-app:
status: Confirmed → Incomplete
tags: added: needs-design
summary: - Correction needed in calculation
+ [calculator-app]Correction needed in calculation
David Planella (dpm) on 2013-09-26
Changed in ubuntu-calculator-app:
importance: Undecided → High
Daniel Oliver (dannioliver) wrote :

"Entering the above into the calculator actually displays the calculation as:

   9
* 9
- 0
= 72

Which is clearly wrong. If you're going to implicitly add numbers to the calculation, you need to actually display them."

Agreed. It doesn't make sense to consider the operator if the user hasn't input any number after that.

"I would expect that after entering an operand such as '+', if I then hit a different operand like 'x' it would change the operand, because I've just changed my mind."

Agreed.

David Planella (dpm) on 2013-09-27
Changed in ubuntu-calculator-app:
status: Incomplete → Triaged
tags: removed: needs-design
Mihir Soni (mihirsoni) on 2013-09-27
Changed in ubuntu-calculator-app:
assignee: nobody → Mihir Soni (mihirsoni-123)
Mihir Soni (mihirsoni) on 2013-09-27
Changed in ubuntu-calculator-app:
status: Triaged → In Progress
Changed in ubuntu-ux:
status: New → Fix Released

Fix committed into lp:ubuntu-calculator-app at revision 165, scheduled for release in ubuntu-calculator-app, milestone alpha-1

Changed in ubuntu-calculator-app:
status: In Progress → Fix Committed
John Lea (johnlea) on 2013-09-30
Changed in ubuntu-ux:
assignee: nobody → Christina Li (christina-li)
Sam Bull (dreamsorcerer) on 2013-11-10
Changed in ubuntu-calculator-app:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers