Bug 134192 - computes negative real raised 0 power equals nan
Summary: computes negative real raised 0 power equals nan
Status: RESOLVED FIXED
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: Klaus Niederkrüger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-17 04:14 UTC by Morph The Cat
Modified: 2006-09-17 11:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Diff file for bugfix (1.24 KB, text/plain)
2006-09-17 05:47 UTC, Morph The Cat
Details

Note You need to log in before you can comment on or make changes to this bug.
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