Summary: | kcalc allows to input multiple decimal points | ||
---|---|---|---|
Product: | [Applications] kcalc | Reporter: | Imron <imraanbarotov> |
Component: | general | Assignee: | Gabriel Barrantes <gabriel.barrantes.dev> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | gabriel.barrantes.dev, minelorderagon16 |
Priority: | NOR | ||
Version First Reported In: | 24.12.2 | ||
Target Milestone: | --- | ||
Platform: | macOS (DMG) | ||
OS: | macOS | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Imron
2025-02-26 20:01:17 UTC
I am new to KDE, but if possible wanted to work on these. Would really appreciate some head start. (In reply to Imron from comment #0) > SUMMARY > > I found out that in kcalc the multiple decimal points are permissible, even > though it is mathematically incorrect. It gives Syntax error when "123....1" > is inputted, however with "123.1.1.1" does some calculations. I went over > the handbook for kcalc, however did not find any information behind this > calculation. > > STEPS TO REPRODUCE > 1. Open kcalc > 2. input 123.1.1.1 (makes the input equal to 1.231) + 123.1.1.1 > > OBSERVED RESULT > > Does some calculations, producing 2.462 > > EXPECTED RESULT > > It should output input or syntax error. > > SOFTWARE/OS VERSIONS > Windows: > macOS: Sonoma 14.0 > (available in the Info Center app, or by running `kinfo` in a terminal > window) > Linux/KDE Plasma: > KDE Plasma Version: > KDE Frameworks Version: > Qt Version: 6.8.1 > > ADDITIONAL INFORMATION Was able to replicate on my system. Will mark as confirmed. there are instructions for contributing to KDE on the website, under the "Get Involved" button in the top bar. Thank you. I will work on this bug. (In reply to Imron from comment #3) > Thank you. I will work on this bug. Godspeed (In reply to Imron from comment #3) > Thank you. I will work on this bug. Hey, (maintainer here) so, what is probably happening is that inputs of the form .d+ (d a digit) are actually valid (no leading zero is required), and the parser "accepts" two consecutive numbers just fine as long it can determine where one finish and the next starts, so probably 123.1.1.1 gets parsed as 123.1|0.1|0.1 and the calculator assumes a multiplication operation bewteen the numbers yielding 123.1*0.1*0.1 to fix this a change in the regex to parse must be introduced, not allowing the last character to be a decimal point (. or ,), open a MR if you want some guidance. The parser has become kinda complex to handle all such cases and I think some rework is need it before this but this can be merged no problem as it is now. Hello, yes I see how this works now. I think on invent KDE there is already a commit about the multiple decimal insertion. Is it still actual for me to work on this or the change is already approved? (In reply to Imron from comment #6) > Hello, yes I see how this works now. I think on invent KDE there is already > a commit about the multiple decimal insertion. Is it still actual for me to > work on this or the change is already approved? Hasn't, talk to the guy is working on it, see if he wants some help. |