Bug 475018 - HEX->BIN conversion is calculating wrong values
Summary: HEX->BIN conversion is calculating wrong values
Status: RESOLVED NOT A BUG
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: 20.12.2
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Evan Teran
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-29 10:12 UTC by Peter Kortmann
Modified: 2024-03-12 14:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kortmann 2023-09-29 10:12:27 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. Open KCalc
2. Change to logic mode
3. Change input to HEX, enter 55 (0x55)
4. convert to binary -> click on Bin
5. the conversion should have 8 bits but shows only 7 bits

OBSERVED RESULT
101 0101
the conversion should have 8 bits but shows only 7 bits

EXPECTED RESULT
1010 1010
the conversion should have 8 bits but shows only 7 bits

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Debian 12, 5.78.0
(available in About System)
KDE Plasma Version: 5.78.0
KDE Frameworks Version:  
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Efe Ciftci 2023-09-29 11:16:50 UTC
The decimal number 5 (0x5 in hexadecimal) is represented as "(0)101" in binary (4+1), therefore I don't see anything wrong with 0x55 -> (0)101 0101. 1010 1010 is 0xAA.
Comment 2 Paul Worrall 2024-03-12 14:51:33 UTC
Setting to "Not a bug" because the conversion is correct and leading zeroes are not shown in any of the number systems