https://bugs.kde.org/show_bug.cgi?id=529046
Bug ID: 529046
Summary: Input with two decimal separators is silently parsed
as implicit multiplication instead of raising a syntax
error
Classification: Applications
Product: kcalc
Version First 26.08.3
Reported In:
Platform: CachyOS
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
SUMMARY
When a number is typed with two decimal separators (e.g. a typo), KCalc does
not
report an error. Instead, it splits the input into two numbers and multiplies
them
implicitly, producing a plausible but wrong result.
STEPS TO REPRODUCE
1. Use a locale where the decimal separator is a comma (here: fr_FR).
2. Type: 854,36,24
3. Press Enter / "=".
OBSERVED RESULT
KCalc displays 205,0464, i.e. it evaluates the input as 854,36 × 0,24:
- "854,36" is read as a first number,
- ",24" is read as a second number with a leading decimal separator (0,24),
- the two adjacent numbers are then joined by implicit multiplication.
EXPECTED RESULT
A syntax error (or the second separator being rejected while typing), since
"854,36,24" is not a valid number. Implicit multiplication makes sense for
cases
like "2π" or "3(4+1)", but it should not apply between two numeric literals.
Here it silently turns a typo into a believable wrong result.
The same probably happens with "." in locales that use a dot as the
decimal separator (e.g. 854.36.24).
--
You are receiving this mail because:
You are watching all bug changes.