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

            Bug ID: 521472
           Summary: Copying from Numeral System mode to Scientific mode
                    causes incorrect results
    Classification: Applications
           Product: kcalc
      Version First unspecified
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

DESCRIPTION
I was recently stumped as to why a calculation I was doing made no sense and
why I kept getting answers that didn't make sense. I needed to take the
hexadecimal value 0x894A5 and divide it by 2^20 (0x100000). So I entered 894A5
in Numeral System mode (hex entry) then right-clicked on the decimal conversion
just below the entry field and selected copy.

I then switched to Scientific mode (as the result was going to be a float),
pasted the result, and then divided by 1048576 (2^20 or 0x100000). The answer
shown was 0.000536290168762 which... didn't make any sense at all. I was
completely stumped until I realized what the issue was: when you copy the
decimal value from the conversion text in Numeral System mode, it **adds a
comma** as a separator between the hundreds and thousands. So I was pasting
562,341 instead of 562341 (the decimal conversion of 0x894A5). So the comma
acted like a decimal point and the answer shown was actually 562.341/1048576
and not 562341/1048576.

STEPS TO REPRODUCE
1. Enter a hexadecimal number greater than 0x270F in Numeral System mode.
2. Right-click the decimal conversion below and copy it.
3. Switch to Scientific mode, and paste the copied value.
4. Any operations done will be on the first grouping of digits only, ignoring
the remainder.

OBSERVED RESULT
562341/1048576=0.000536290168762

EXPECTED RESULT
562341/1048576=0.536290168762

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.6.5
KDE Frameworks Version: 6.27.0
Qt Version: 6.11.1
Kernel Version: 7.0.11-arch1-1 (64-bit)

ADDITIONAL INFORMATION
I am pretty sure this isn't a duplicate, I checked through and searched for
similar terms but didn't find anything. My apologies if this has been reported.

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

Reply via email to