Cannot calculate any formula containing 'e'

Bug #1467316 reported by Niklas Wenzel
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu Calculator App
Triaged
Medium
Bartosz Kosiorek

Bug Description

How to reproduce:

Type in 'e^2' or 'e+3' and press enter. Nothing is calculated.

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Confirmed. There is only to change line 169 of app/engine/formula.js from E to e

Changed in ubuntu-calculator-app:
status: New → Triaged
importance: Undecided → High
tags: added: bitesize
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

Very strange. It is working perfectly for me.
I tested it on BQ phone and on Desktop (by using physical keyboard).

In engine "E" is for Euler number and "e" is for big/small numbers eg. "10e+1.5".

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Uh, right, wrong fix.

Anyway, I can confirm the bug, trunk on vivid.

Which version of Ubuntu are you using? And qmlscene?

apt-cache show qmlscene | grep Version
Version: 5.4.1-1ubuntu7

tags: removed: bitesize
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

Actually, it doesn't happen each time the app is launched, only something like 3 times every 5.

The error is `qml: Error: math.js TypeError: Type error engine formula:E+1.5`, so it's raised by the engine.

I was unable to reproduce it with upstream library, so we need to find why it fails randomly. I was able to see it fail also on phone with OTA-4

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

I'm using 15.04:
apt-cache show qmlscene | grep Version
Version: 5.4.1-1ubuntu5

On BQ phone I'm using stable image.

Revision history for this message
Niklas Wenzel (nikwen) wrote :

I was referring to the Euler number here.
However, it's a strange bug as I am right now unable to reproduce it again as well while yesterday evening I was unable to get it working properly...

Revision history for this message
Marco (jermy-07) wrote :

Can reproduce. What should I do?

Changed in ubuntu-calculator-app:
importance: High → Medium
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

Could you please check if it is still an issue with latest calculator version?
Last time we upgraded math.js to 2.4, and this issue could be resolved.

Changed in ubuntu-calculator-app:
status: Triaged → Incomplete
Revision history for this message
Niklas Wenzel (nikwen) wrote :

It took me about 10 to 15 tries but then I constantly hit the problem again. (Tested on the desktop.)

Changed in ubuntu-calculator-app:
status: Incomplete → Confirmed
status: Confirmed → Triaged
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

I reproduced bug with following script. Seems it is an bug in math.js
The bug was already submitted:
https://github.com/josdejong/mathjs/issues/505

Changed in ubuntu-calculator-app:
status: Triaged → In Progress
assignee: nobody → Bartosz Kosiorek (gang65)
Revision history for this message
Bartosz Kosiorek (gang65) wrote :
Revision history for this message
Wjosdejong (wjosdejong) wrote :

@Bartosz I can't manage to reproduce the issue using your code example in some existing Qt project that I had. It just works fine no matter how many times I press "Click me to calculate". The zip file you attached in #11 does not contain any project settings, I guess these can be relevant? (for example, I could not run the math.js code at all in Qt due to a statement `math.import(...)` which Qt doesn't like, apparently you have some settings allowing this in your Qt project?).

Can you provide a script example including Qt project settings and everything?

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

you need to restart whole qml application 20 times to reproducevthat issue. With clicking you will not reproducevthat issue.

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

I run this Qml application directly from console: qmlscene hello.qml.
Do you know how to get such project settings?

Revision history for this message
Marco (jermy-07) wrote :

Reproduced by clicking the text and closing 20 times:

$ for i in {1..20};do qmlscene hello.qml;done
file:///tmp/hello-bignumber-euler-number/math.js:33727: TypeError: Type error

Revision history for this message
Wjosdejong (wjosdejong) wrote :

@Bartosz No idea, just a guesst. I tried to run your code from #11 via the Qt editor, that throws an exception:

    file:///home/jos/tmp/test7/math.js:117 Expected token `identifier'

So I was just wondering how you guys get this code running at all... All I can think of (not being familiar with Qt) is we have different versions of stuff, or different project settings or something like that. I'm running Linux Mint 17.2 64-bit, qmlscene 5.2.1.

Besides that, when I change line 117 from `math.import(....)` to `math['import'](...)` I can run the code.

@Marco thanks. I run your loop starting the code 20 times, click the text, and close them one by one. Just works fine.

Revision history for this message
Marco (jermy-07) wrote :

Not sure why you can't reproduce. 20 was just a rough estimate and hope it is sufficient to trigger at least once.

$ qmlscene --verbose
Qt 5.5.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.1.1 20150618 (Red Hat 5.1.1-4))

Changed in ubuntu-calculator-app:
status: In Progress → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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