Version: 3.5.4-2.0 (KDE-RedHat RPMs) (using KDE KDE 3.5.4) Installed from: Fedora RPMs Compiler: gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1) OS: Linux Steps to reproduce: 1. Open kcalc in decimal mode. 2. 2 ^ 59 3. Returns: 576460752303423488 4. Switch to hex: Expected result: 0x800000000000000 Actual result: 0x1000000000000000 Just to verify: 5. Switch back to decimal. 6. Subtract 1. 7. Returns: 576460752303423487 8. Switch to hex. Expected result: 0x7FFFFFFFFFFFFFF Actual result: 0x1000000000000000 Decimal math seems to be OK. Decimal to Hex conversion seems to be broken. (32bit only?) FYI: FC5/x86_64 - Gilboa
Steps 1-4 work fine here (32 bit system), but 5-8 give the wrong answer (0x7FFFFFFFFFFFFC0).
I believe I have fixed this now in the cvs-trunk (both for KDE-3.5.5 and for KDE-4.0). Please test this, if you have time! Thank you for reporting this bug!!! Klaus
Klaus, Can you attach a patch? I'll add it to the kdebase RPM patch-list, rebuild and test the fix. - Gilboa
Created attachment 17806 [details] Patch made from svn for KDE-3.5.4 I hope this helps. Klaus
Seems to be fixed.
No go. I took the patch and applied it against 3.5.4 1. Open kcalc in decimal mode. 2. 2 ^ 59 3. Returns: 576460752303423488 4. Switch to hex: Expected result: 0x800000000000000 Actual result: 0x4000000000000000 5. Switched back to decimal. Expected result: 576460752303423488 Actual result: 9223372036854775808 Any chance this fix requires 3.5.5? - Gilboa
I tested Klaus' latest patch and the bug seems to have been resolved. Thanks. - Gilboa
Marking as resolved.
Spoke too soon. I took the patch and applied it against 3.5.4 1. Open kcalc in decimal mode. 2. 2 ^ 59 3. Returns: 576460752303423488 4. Switch to hex, result: 0x800000000000000 (OK). 5. Switched back to decimal, substract 1. 6. Returns: 576460752303423487 (OK). 7. Switch back to hex: Expected result: 0x7FFFFFFFFFFFFFFF Actual result: 0x8000000000000000 - Gilboa
This works fine for me in kcalc 3.5.5 from Debian
Created attachment 18813 [details] Fix? Klaus, This patch seems to solve the problem. It's based around your patch. (I just added the x86_64 ifdef) As expected in 64bit sizeof(long long int) == sizeof(long). (Unless you're using Windows...) Thanks, and sorry for taking my sweet time testing your fix ;) - Gilboa
This bug seems to have been finally fixed. Thanks Gilboa (and after your wish in your last email, I started to read things on wikipedia. I learned something new. Interesting.). Klaus
Happy to help. Thanks for the fix.