Bug 134192

Summary: computes negative real raised 0 power equals nan
Product: [Applications] kcalc Reporter: Morph The Cat <tuxman99999>
Component: generalAssignee: Klaus Niederkrüger <kniederk>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Diff file for bugfix

Description Morph The Cat 2006-09-17 04:14:51 UTC
Version:           2.0.4 (using KDE KDE 3.5.4)
Installed from:    Slackware Packages
Compiler:          GNU GCC 3.4.6 
OS:                Linux

Entering a negative real number (i.e. -1.438) to the 0 power using the x^y gives answer of nan (not a number).  The mathematically correct answer of any non-zero real raised to zero power is 1, and both GNU bc and my TI-89 handheld calculator give the correct answer to the above problem.

Steps to recreate:
==================
1. Run kcalc
2. Enter a number with a decimal (fractional) value. Example: 2.7
3. Press the +/- key to negate this number
4. Enter 0
5. Press the x^y (exponentiation) key
6. Kcalc displays the incorrect result nan (not a number).
Comment 1 Morph The Cat 2006-09-17 05:47:12 UTC
Created attachment 17804 [details]
Diff file for bugfix

I've tested this fix for KCalc, it now properly computes <negative real> raised
to 0 power = 1.
Comment 2 Klaus Niederkrüger 2006-09-17 11:33:39 UTC
Thanks for the bug fix.
Klaus