Version: 2.8 (using KDE 4.6.3) OS: Linux kcalc miscalculates tan(0) = ∞ instead of 0. kcalc miscalculates sin(0)/1.23 = ∞ instead of 0. kcalc calculates 1/0 = ∞. kcalc miscalculates cos(0)/0 = hang at 100% cpu instead of ∞. kcalc miscalculates ln(2)/0 = hang at 100% cpu instead of ∞. Reproducible: Always Steps to Reproduce: 0t 0s/1.23 1/0 0c/0 2n/0 Actual Results: inf inf inf hang at 100% cpu hang at 100% cpu Expected Results: 0 0 inf inf inf
Cannot reproduce. You probably have a buggy or incompatible version of libm or libgmp. My results are what you listed at "Expected" (and what I expected myself).
My libm and libgmp versions were: sys-libs/glibc-2.12.2 dev-libs/gmp-4.3.2 Upgrading to dev-libs/gmp-5.0.2 and reinstalling kde-base/kcalc-4.6.3 didn't help.
The only one I can reproduce is: "kcalc miscalculates ln(2)/0 = hang at 100% cpu instead of ∞." This one definitely does hang for me, the rest appear to give expected results. I'll see if I can come up with a patch for it.
I've committed a fix for this issue. Which should appear in the KDE 4.7 release as far as I know.
Evan, if you committed to trunk, it will appear in KDE 4.8. Please use the BUG: or CCBUG: keyword on commits so that others can follow your changes.
trunk is already pointed at 4.8? fair enough, I'll "backport" to 4.7/4.6. I thought I did use BUG: xxxx, but I'll make sure I definitely do that in the future.
SVN commit 1240127 by teran: backport of fix BUG: 276568 U knumber.cpp M +9 -2 knumber_priv.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1240127
SVN commit 1240128 by teran: backport of fix BUG: 276568 U knumber.cpp M +11 -4 knumber_priv.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1240128