GNOME Bugzilla – Bug 327214
regression with trigonometic functions and normal arithmetic precedence
Last modified: 2006-01-17 16:27:23 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.
Confirming: gcalctool 5.7.21 on a GNOME 2.12 platform (LANG=en_US.UTF-8)
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.
Created attachment 57540 [details] Fix for the problem.
Change checked into CVS HEAD. Version number in configure.in bumped to 5.7.25.