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 327214 - regression with trigonometic functions and normal arithmetic precedence
regression with trigonometic functions and normal arithmetic precedence
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
5.7.x
Other All
: Normal normal
: ---
Assigned To: Rich Burridge
Rich Burridge
Depends on:
Blocks:
 
 
Reported: 2006-01-16 15:18 UTC by Tino Meinen
Modified: 2006-01-17 16:27 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Fix for the problem. (432 bytes, text/plain)
2006-01-17 16:22 UTC, Rich Burridge
Details

Description Tino Meinen 2006-01-16 15:18:43 UTC
Please describe the problem:
gcalctool shows wrong or unexpected behavior. I know this is a bit vage but the
below I will write down the steps to reproduce the behaviour.

Steps to reproduce:
1. set gcalctool to scientific mode and if neccesary uncheck "use arithmetic
precedence", set gcalctool to use degrees.

2. try to caclulate 2*sin(30) by pressing: '30', then 'sin' and then 'x' 2
3. the answer is 1.047197551 but it should be 1.

what happens is that as soon as you press 'x' for the multiplication, gcalctool
makes a calculation where 0.5 is converted to 0.523598776. 
That just shouldn't happen.

another example which perhaps shows some more light on what's going on is to
calculate 2*arcsin(0.5) by pressing: '0.5' then check 'inv' and then press sin.
(the answer is 30 degrees which is still correct) now multiply by two, so press:
'x' and then gcalctool suddenly shows: "0.5" (which is the first entered value
we started out with). Now press '2' and '=' and the answer gcalctool gives is:
'1'. It should be 60 (degrees).

So aparently something goes wrong when pressing one of the  + - / or * operators
after performing a trigonometric operation.



Actual results:


Expected results:


Does this happen every time?


Other information:
This is a regression from the behaviour of gcalctool 5.6.31 in gnome 2.12.
Comment 1 Wouter Bolsterlee (uws) 2006-01-16 15:28:21 UTC
Confirming: gcalctool 5.7.21 on a GNOME 2.12 platform (LANG=en_US.UTF-8)
Comment 2 Rich Burridge 2006-01-17 16:21:23 UTC
This problem was caused by the trig code rewrite back in February 2005.
The do_trig() routine needed to set the current result in v->MPdisp_val.
Comment 3 Rich Burridge 2006-01-17 16:22:09 UTC
Created attachment 57540 [details]
Fix for the problem.
Comment 4 Rich Burridge 2006-01-17 16:27:23 UTC
Change checked into CVS HEAD. Version number in
configure.in bumped to 5.7.25.