After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728657 - Calculating log(x) for x 0<x<1 results in error
Calculating log(x) for x 0<x<1 results in error
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
: 734607 (view as bug list)
Depends on: 698400
Blocks:
 
 
Reported: 2014-04-21 14:48 UTC by Moritz
Modified: 2014-12-22 20:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Moritz 2014-04-21 14:48:55 UTC
Hi,

if you try to calculate i.e. log(1/2), gnome-calculator answers with

"*** ERROR OCCURRED IN LNS, NEWTON ITERATION NOT CONVERGING PROPERLY ***".

Calculating values bigger than 1 is fine, but calculating negative values results wrong values i think.

log(-1) should produce pi*i but shows 1,364376354i

Im running gnome-calculator 3.12.1 on ArchLinux with german locale

Regards
Comment 1 Matthias Clasen 2014-04-23 00:26:10 UTC
you are confusing log and ln

ln -1 = pi * i

log -1 = ln -1 / ln 10 = 1.36... * i
Comment 2 Martin Simon 2014-05-19 18:36:23 UTC
I can reproduce the bug too. It's also affecting numbers bigger than one, e.g. log_2(15) in my case.. I've tested it in gnome-calculator build from source got via jhbuild on 2014-05-19.
Comment 3 gok+gnomebugs 2014-07-18 14:25:33 UTC
Hi,

I can reproduce the bug too, with either log(1/2) or log_2(15).
I encountered this bus when trying to evaluate this formula: 3×ln (1−e(−(500×3)÷10000)).
gnome-calculator manages to evaluate it when replacing 500 by 499 or 501 in the above formula

I am using gnome-calculator 3.12.3 on Arch Linux (French locale, however I do not think locale matters).
Comment 4 MariusM 2014-08-11 11:17:34 UTC
*** Bug 734607 has been marked as a duplicate of this bug. ***
Comment 5 PioneerAxon 2014-12-22 20:48:15 UTC
Moritz,

Thank you for the bug report.

The issue has been fixed in master branch. The Calculator now generates correct answer for all the inputs discussed in the conversation.

Reference commit : https://git.gnome.org/browse/gnome-calculator/commit/?id=0e863eeb121d670d8f5266a82b6152e98b2428ea

Hope this helps.. :)