We have moved to a new Sailfish OS Forum. Please start new discussions there.
48

Bug: Can't divide by previous result in calculator

Tracked by Jolla

asked 2014-01-30 12:56:21 +0200

Nilux gravatar image

updated 2015-10-26 06:47:49 +0200

In the native calc-application, I can't divide number with previous result. For example 5×3 and then 25/<previous result> results in 15/0 when it should result in 25/15. In other words, we have "25" as the numerator, so tapping the previous result should put it below the line, but actually it replaces "25".

Calculator Fractions

edit retag flag offensive close delete

Comments

This is still not working in 1.0.5.16. All other operand are working properly though. It looks like because division is treated as a block by itself., whereas other operations generate new blocks.

Damien Caliste ( 2014-04-16 10:50:32 +0200 )edit

Yes, can confirm it on Tahkalampi 1.0.8.21

anandrkris ( 2014-12-09 11:53:04 +0200 )edit

Yes, can confirm it also on 1.1.1.27 :)

anandrkris ( 2015-02-03 18:38:07 +0200 )edit
1

When I just tried it this happened:

100 / 5 = 20 1 / [press on result] [denominator shifts to numerator position] 20 / 0 = infinity

So, when I enter 1 / the previous result, the previous result is actually shifted from the place of the denominator to the place of the numerator. The previous numerator disappears altogether and the new denominator is zero.

bilgy_no1 ( 2015-05-24 11:44:11 +0200 )edit
1

Still exists on 1.1.6.27

AliN ( 2015-06-24 20:25:37 +0200 )edit

4 Answers

Sort by » oldest newest most voted
11

answered 2015-05-24 01:23:14 +0200

Odorobo gravatar image

Bump. This long known bug makes me sad, and it is still not fixed.

edit flag offensive delete publish link more
3

answered 2017-09-21 20:40:02 +0200

Fuzzillogic gravatar image

A mediocre workaround for now: first divide by 1, then divide again by the number you actually want.

image description

You can now edit both dividend (12, A) and divisor (3, B)

To do "divide 1 by a previous result", enter 1 ÷ 1 ÷ [tap previous result]:

image description

edit flag offensive delete publish link more
2

answered 2018-11-15 16:28:47 +0200

ottulo gravatar image

Another bump on this one. Still exists in Sailfish X 3.0.0.8, after nearly five years!

edit flag offensive delete publish link more
0

answered 2016-02-12 11:46:11 +0200

Not really a proper fix, but anyway, it allows to do calculations without copying result by hand. Here is a patch that circumvents the bug in DeclarativeField::link() proprietary function. When a fraction is used, the denominator is copied instead of being linked.

--- CalculationsListView.qml    2015-09-05 00:28:38.000000000 +0200
+++ CalculationsListView.qml.new    2016-02-12 10:33:55.367393552 +0100
@@ -110,7 +110,7 @@
                     linkText: calculation.result.linkText
                     coverMode: calculationsListView.coverMode

-                    onClicked: activeCalculation.focusField.link(calculation.result)
+                    onClicked: activeCalculation.focusField.fraction ? activeCalculation.insert(calculation.result.valueText) : activeCalculation.focusField.link(calculation.result)
                 }
             }
         }

The proper fix would be to change the proprietary function to asign the DeclarativeResult to the denominator when DeclarativeField::fraction is true.

edit flag offensive delete publish link more

Comments

It will be nice if this is discussed with Jolla on dev IRC :)

anandrkris ( 2016-02-12 14:01:05 +0200 )edit

Yes, but I'm afraid that sailors are too busy with more important stuff like telephony and so on to take time for this small bug. Besides the patch is just a workaround and not a fix since IMHO the bug is in the C++ proprietary side. So this patch won't really help them. It's more of a push from me to go in the open source direction for the calculator : community can help !

Damien Caliste ( 2016-02-13 00:02:32 +0200 )edit
1

To me this seems like a bug which could be fixed in 15 minutes. Yeah there are more important things, yadayada, but I find these kind of bugs, trivial to reproduce and probably trivial to fix, perfect in-between fillers, e.g. at the end of the day, or between two larger tasks, or just because the damn ticket is too simple to leave it on the board for so long.

I really like the calc app. Delightfully simple and powerful. But this bug... come on. Just ditch the special divider notation, and make it like the other operators, i.e. 15 ÷ 3 = 5

Fuzzillogic ( 2016-02-13 00:28:24 +0200 )edit

https://together.jolla.com/question/57069/calculator-source-code/ Am sure you must have voted here - Ideal candidate, don't believe anything is proprietary in this simple app! ;)

anandrkris ( 2016-02-18 12:24:05 +0200 )edit

Yes voted already. The pseudo-patch above was more an attempt to show what open source can do than a real patch for this issue.

Damien Caliste ( 2016-02-18 19:38:11 +0200 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2014-01-30 12:56:21 +0200

Seen: 864 times

Last updated: Nov 15 '18