Bug 185734

Summary: kcalc from Fedora kdeutils trig bug probably because deg/rad/grad mode uninitialised
Product: [Applications] kcalc Reporter: Philip Smith <philip.smith.ucl>
Component: generalAssignee: Klaus Niederkrüger <kniederk>
Status: RESOLVED FIXED    
Severity: normal CC: kde, philip.smith.ucl
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Philip Smith 2009-02-27 19:12:53 UTC
Version:           2.4 (using KDE 4.2.0)
OS:                Linux
Installed from:    Fedora RPMs

Description of problem:
kcalc sometimes calculates cos(0)=0 if deg/rad/grad is left on initial "deg" button selection

Version-Release number of selected component (if applicable):
kdeutils-4.2.0-1.fc10.x86_64

How reproducible:
random: probably depends on uninitialized memory value
sometimes works, sometimes doesn't on 3 different computers running Fedora 9 and 10 AMD and Intel.

1. start kcalc: display says "0"
2. enable Settings->science: display says "deg"
3. click "cos" button
4. get answer 0 which is the result of a "cos" of the initial "0" in degrees
5. click on rad
6. click on deg
7. click "cos" button
8. get correct answer 1

Actual results:
answer 0 first time (step 4), answer 1 second time (step 8)

Expected results:
answer 1 both times

Additional info:
Looks like _angle_mode is never initialised in the code even though "deg"
button is selected on startup

See also 1. start kcalc: display says "0"
2. enable Settings->science: display says "deg"
3. click "cos" button
4. get answer 0 which is the result of a "cos" of the initial "0" in degrees
5. click on rad
6. click on deg
7. click "cos" button
8. get correct answer 1

Actual results:
answer 0 first time (step 4), answer 1 second time (step 8)

Expected results:
answer 1 both times

See also:
https://bugzilla.redhat.com/show_bug.cgi?id=487020
Comment 1 Nicolas L. 2009-02-28 00:47:40 UTC
confirmed
Comment 2 Nicolas L. 2009-02-28 01:30:14 UTC
fixed on branch revision 919387
Comment 3 Philip Smith 2009-03-05 13:56:02 UTC
In fact, isn't this bug just a duplicate of 181875 which was fixed before this was opened?