Continuos calculation doesn't work with irrational results

Bug #1357983 reported by Alan Pope 🍺🐧🐱 🦄
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Ubuntu Calculator App
Fix Released
Critical
Riccardo Padovani

Bug Description

Do the following:-

6/2=
Result=3
-1=
Result=2

The calculation works okay and displays fine.

However try:-

5/3=
Result=1.6666667
-1=
Result=0.55555556
However the "-1" bit doesn't get displayed.

Related branches

Changed in ubuntu-calculator-app:
status: New → Confirmed
Changed in ubuntu-calculator-app:
importance: Undecided → Critical
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Oh, that's weird.

Well, the bug is a bit different: after a irrational number, continuos calculation doesn't work.
Look, 0.55555556 is 5/3/3, so the app doesn't take the '-1' and when you click = it continues with previous operator.

You can check with also 1/3, and other irrational numbers

summary: - Screen doesn't update for some calculations
+ Continuos calculation doesn't work with irrational results
Changed in ubuntu-calculator-app:
status: Confirmed → Triaged
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Let's make sure to add a regression test for this :-)

Revision history for this message
Bartosz Kosiorek (gang65) wrote :

the problem is that saving partial result, that are longer of CALC.PRECISION we cannot add another sign, this because engine.js check the length of the calci

Before 1/3=+1 had a length of 4
Now is 1/3= that becomes 0.3333333333333333
so you can't add 1

The code is here:
http://bazaar.launchpad.net/~ubuntu-calculator-dev/ubuntu-calculator-app/trunk/view/head:/engine.js#L358
This is right because we don't want to long numbers
so we need a workaround
but if you start to add console.log you see that is here the operation stop

Changed in ubuntu-calculator-app:
assignee: nobody → Bartosz Kosiorek (gang65)
status: Triaged → In Progress
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Any update about this? this is very critical

Revision history for this message
Riccardo Padovani (rpadovani) wrote : Re: [Bug 1357983] Re: Continuos calculation doesn't work with irrational results

On Aug 23, 2014 1:47 AM, "Renato Araujo Oliveira Filho" <
<email address hidden>> wrote:
>
>
> Any update about this? this is very critical

I have a fix for this, but we lost a lot of precision with irrational
numbers; so, if Bartosk or I don't find a good fix during the weekend, I'll
do a MR on Monday.

Regards,
R.

Changed in ubuntu-calculator-app:
assignee: Bartosz Kosiorek (gang65) → Riccardo Padovani (rpadovani)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Hi guys can we release the fix? Is impossible to use the app with this bug.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

Fix committed into lp:ubuntu-calculator-app at revision None, scheduled for release in ubuntu-calculator-app, milestone 1.6

Changed in ubuntu-calculator-app:
status: In Progress → Fix Committed
David Planella (dpm)
Changed in ubuntu-calculator-app:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.