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 711766 - No zero results in some cases
No zero results in some cases
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
3.8.x
Other Linux
: Normal minor
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-10 10:00 UTC by Kyrylo V. Polezhaiev
Modified: 2016-05-09 10:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (942 bytes, patch)
2014-02-23 20:40 UTC, Daniel Renninghoff
committed Details | Review

Description Kyrylo V. Polezhaiev 2013-11-10 10:00:23 UTC
Type 2-2 and press Enter. You get 0.
Type e^(iπ)+1 and press Enter. Empty string.
But if you type just e^(iπ) you get -1.
Comment 1 Daniel Renninghoff 2014-02-23 20:40:14 UTC
Created attachment 270063 [details] [review]
patch

Wow, it took me some hours of debugging this but finally I traced this back to the ln() function, which calculated slightly more than 1 when you do ln(e^1). This patch fixes this and also fixes this bug.

In the long run the algorithm should maybe be made better or replaced by something else completely.
Comment 2 Kyrylo V. Polezhaiev 2014-02-23 20:49:46 UTC
Cool, Daniel!
We need to fix it and put to the repo.
Comment 3 PioneerAxon 2014-02-24 16:55:32 UTC
Review of attachment 270063 [details] [review]:

Committed.
Awesome work!

Thank you for the patch. :)
Comment 4 PioneerAxon 2014-02-24 17:02:24 UTC
Kyrylo,
Thank you for the bug report.
The issue has been fixed in master branch. The changes will be available in next major release of calculator. :)
Comment 5 Kyrylo V. Polezhaiev 2014-02-25 15:07:59 UTC
I think I need to redirect thanks to Daniel Renninghoff who actually found the bug.
I even forget about this report.
Comment 6 Robbie Smith 2016-05-09 03:29:20 UTC
This bug still occurs in gnome-calculator 3.20.x. I'd attach some screenshots to demonstrate, but the "Attach File" button doesn't seem to show for Resolved bugs, so I put the image up on imgur instead:

http://imgur.com/Qd8Kp9F

Operating system is Arch Linux x86-64, last updated on Saturday 2016-05-07
GNOME 3.20.x

On a fresh start of the application, entering e^(iπ)+1 results in an empty answer, and immediately trying e^(iπ) results in "Malformed expression", as does e^(i×π). Trying another calculation, and then entering e^(iπ) returns the expected result 0.
Comment 7 Kyrylo V. Polezhaiev 2016-05-09 10:40:33 UTC
Okay, I can confirm. Seems to be empty string again.