GNOME Bugzilla – Bug 711766
No zero results in some cases
Last modified: 2016-05-09 10:43:18 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.
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.
Cool, Daniel! We need to fix it and put to the repo.
Review of attachment 270063 [details] [review]: Committed. Awesome work! Thank you for the patch. :)
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. :)
I think I need to redirect thanks to Daniel Renninghoff who actually found the bug. I even forget about this report.
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.
Okay, I can confirm. Seems to be empty string again.
https://github.com/GNOME/gnome-calculator/blob/44498f2e02c5fc64fa9bb1953a8b06b18d51b926/lib/number.vala#L1286