Bug 465565 - When manipulating bits in numeral systems mode, kcalc switches from signed to unsigned display.
Summary: When manipulating bits in numeral systems mode, kcalc switches from signed to...
Status: RESOLVED FIXED
Alias: None
Product: kcalc
Classification: Applications
Component: general (other bugs)
Version First Reported In: 22.08.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Johannes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-10 23:09 UTC by farmboy0
Modified: 2025-06-23 14:35 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description farmboy0 2023-02-10 23:09:48 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

STEPS TO REPRODUCE
1. switch to numeral systems mode
2. switch base to decimal
3. enter a negative number i.e. -300
4. click one of the 64 bit fields

OBSERVED RESULT
Clicking bit 8 will show: 18446744073709551188

EXPECTED RESULT
Showing the result as a signed number

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Gentoo/KDE 5.26.5
(available in About System)
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 Johannes 2025-06-23 14:33:48 UTC
Git commit 11748ab4a51debdc5738625da783a4710b61f293 by Johannes Elgaard.
Committed on 23/06/2025 at 14:14.
Pushed by gabrielbarrantes into branch 'master'.

Bit manipulation now works with negative numbers

Changed KCalcBitset operate on signed integers, so that manipulating
bits of negative numbers does not cause a sudden change to a huge
positive number.

M  +1    -1    kcalc.cpp
M  +1    -1    kcalc.h
M  +3    -3    kcalc_bitset.cpp
M  +4    -4    kcalc_bitset.h

https://invent.kde.org/utilities/kcalc/-/commit/11748ab4a51debdc5738625da783a4710b61f293