https://bugs.kde.org/show_bug.cgi?id=487837

            Bug ID: 487837
           Summary: Starting a binary number with zero shifts the first
                    '1' 2 positions to the left
    Classification: Applications
           Product: kcalc
           Version: 24.05.0
          Platform: Manjaro
                OS: Linux
            Status: REPORTED
          Severity: major
          Priority: NOR
         Component: general
          Assignee: evan.te...@gmail.com
          Reporter: snellejelle9...@gmail.com
  Target Milestone: ---

Created attachment 170017
  --> https://bugs.kde.org/attachment.cgi?id=170017&action=edit
Screenshots

SUMMARY
When in numeral system mode.
Inputting a binary number starting with a 0 results in an output that is
shifted 2 to the left.

STEPS TO REPRODUCE
1. Start Kcalc and enter numeral system mode
2. Select the "bin" checkmark
3. Type "10" and press '='.
4. Verify that the result is "10" in bin and "2" under hex. (As expected :))
5. Clear the registers by pressing the 'C' button.
6. Type "010" and press '='.
7. Verify that the result is "1000" in bin and "8" under hex. (Not good :((
8. Clear the registers by pressing the 'C' button.
9. Type "011" and press '='.
10. Verify that the result is "1001" in bin and "9" under hex. (Not good :((

I have repeated this with numbers of different lengths and the result is always
the same.


OBSERVED RESULT
First 1 after a leading 0 is shifted 2 positions left in binary input mode.

EXPECTED RESULT
Leading 0's are stripped from the input and the first 1 is not shifted.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Linux 6.6.32-1 Manjaro
(available in About System)
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
Graphics platform: Wayland

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to