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 172150 - Exponential function button faulty
Exponential function button faulty
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
5.5.x
Other All
: Normal normal
: ---
Assigned To: Sami Pietilä
Sami Pietilä
: 303736 305859 306277 316679 317053 317185 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-03-30 19:54 UTC by Sebastien Bacher
Modified: 2005-09-26 14:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The fix. (1.29 KB, patch)
2005-04-13 16:21 UTC, Sami Pietilä
none Details | Review

Description Sebastien Bacher 2005-03-30 19:54:13 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."
Comment 1 Rich Burridge 2005-03-30 20:26:13 UTC
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.
Comment 2 Rich Burridge 2005-03-30 20:26:51 UTC
Sami, please investigate and fix. Thanks.
Comment 3 Sami Pietilä 2005-03-30 21:57:18 UTC
The problem is that parser is now thinking that e is a hex number e (=14).
Comment 4 Sami Pietilä 2005-03-31 18:40:25 UTC
Fix committed to CVS HEAD, please test.
Comment 5 Rich Burridge 2005-03-31 18:51:24 UTC
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.
Comment 6 Sebastien Bacher 2005-04-13 11:21:13 UTC
GNOME 2.10.1 has still this bug, reopening
Comment 7 Rich Burridge 2005-04-13 14:52:50 UTC
Sami, you need to attach a "cvs diff -u" so that this fix can be 
applied to the GNOME 2.10 branch.
Comment 8 Sami Pietilä 2005-04-13 16:21:06 UTC
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.
Comment 9 Rich Burridge 2005-04-13 16:41:20 UTC
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.

Comment 10 Rich Burridge 2005-04-13 16:50:35 UTC
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.
Comment 11 Sami Pietilä 2005-04-13 17:05:24 UTC
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...
Comment 12 Rich Burridge 2005-04-13 17:16:16 UTC
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.
 
Comment 13 Rich Burridge 2005-04-13 17:20:54 UTC
Changes checked into the "gnome-2-10" branch.
I've bumped the version number in configure.in
to 5.5.43.
Comment 14 Sami Pietilä 2005-05-11 18:48:43 UTC
*** Bug 303736 has been marked as a duplicate of this bug. ***
Comment 15 Sami Pietilä 2005-05-30 17:37:09 UTC
*** Bug 305859 has been marked as a duplicate of this bug. ***
Comment 16 Rich Burridge 2005-06-02 19:25:17 UTC
*** Bug 306277 has been marked as a duplicate of this bug. ***
Comment 17 Rich Burridge 2005-09-19 14:32:38 UTC
*** Bug 316679 has been marked as a duplicate of this bug. ***
Comment 18 Rich Burridge 2005-09-23 18:08:17 UTC
*** Bug 317053 has been marked as a duplicate of this bug. ***
Comment 19 Rich Burridge 2005-09-26 14:16:50 UTC
*** Bug 317185 has been marked as a duplicate of this bug. ***