GNOME Bugzilla – Bug 172150
Exponential function button faulty
Last modified: 2005-09-26 14:16:50 UTC
This bug has been opened here: https://bugzilla.ubuntu.com/8366 "In the latest Hoary, the e^x button in gcalctool doesn't work. I pressed [e^x], followed by a [1], which should return the value of e, i.e., 2.71828..., but instead I get 14. I try [e^x], [2], and this returns 196, which is just 14^2. It seems that e==14 (!) Note that the constant e in the [Con] button is correctly valued and has nothing to do with the above."
This just seems to be a problem in "Use Arithmetic Precedence Mode". The online help and manual pages for this operation state: e^x [ { ] Returns e raised to the power of the current entry. So (in non-arithmetic precedence mode), you would enter (say) "1" then hit the e^x button, and get the result of 2.718281828. Transferring to Sami for further investigation.
Sami, please investigate and fix. Thanks.
The problem is that parser is now thinking that e is a hex number e (=14).
Fix committed to CVS HEAD, please test.
Sami, When you fix bugs such as these, could you please add an attachment which is a "cvs diff -u" to the bug report. Then, if we need to back-port the patch to the version of gcalctool that's in GNOME 2.10, it's easy to do. Thanks.
GNOME 2.10.1 has still this bug, reopening
Sami, you need to attach a "cvs diff -u" so that this fix can be applied to the GNOME 2.10 branch.
Created attachment 45221 [details] [review] The fix. Once I committed the changes to CVS HEAD, running cvs diff on my tree does not reveal the changes. If I recall correctly the fix consisted the changes I gathered to attached pr172150.diff.
Sami, I applied your patch. When I try gcalctool now (with arithmetic operator precedence mode set), I get the following: Click on the "1" button "1" displayed. Click on the "e^x" button "1e^" displayed Click on the "=" button" Status bar tells me I have a Malformed expression. Either it's still broken, or it's not obvious how this works (i.e. it's not consistent with the way it works in non-arithmetic operator precedence mode). I suggest you do the following. Checkout gcalctool from the gnome-2-10 branch with: % cvs co -r gnome-2-10 gcalctool Apply your changes and debug. Then when it works for you, please commit your changes. When it's fixed, I'll generate a tarball for GNOME 2.10.2. Thanks.
Another point of reference. I get the same errors with gcalctool from CVS HEAD (i.e. the fix for GNOME 2.11/12). Either it's still broken, or it's not obvious/consistent how this operator should be used.
Click on the "e^x" button "e^" is shown. Click on the "1" button "e^1" is shown. Click on the "=" button" This should give 2.718...
It does, but that's totally inconsistent with how it works in non-arithmetic operator precedence mode. Okay, I'll check the fix into the gnome-2-10 branch. I don't like the fact that there are so many inconsistencies with the two different modes, but I guess I'll have to life with them. Thanks.
Changes checked into the "gnome-2-10" branch. I've bumped the version number in configure.in to 5.5.43.
*** Bug 303736 has been marked as a duplicate of this bug. ***
*** Bug 305859 has been marked as a duplicate of this bug. ***
*** Bug 306277 has been marked as a duplicate of this bug. ***
*** Bug 316679 has been marked as a duplicate of this bug. ***
*** Bug 317053 has been marked as a duplicate of this bug. ***
*** Bug 317185 has been marked as a duplicate of this bug. ***