Bug 489980

Summary: uppercase exponential not understood
Product: [Applications] kcalc Reporter: S. Umar <sait.a.umar>
Component: generalAssignee: Gabriel Barrantes <gabriel.barrantes.dev>
Status: RESOLVED FIXED    
Severity: normal CC: gabriel.barrantes.dev
Priority: NOR    
Version First Reported In: 24.05.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description S. Umar 2024-07-09 15:32:02 UTC
If I input 3.6434E+01 into kcalc it gives me "input error" but lowercase version  3.6434e+01 gvies 36.434. Uppercase is iseful when pasting from outputs (like fortran) which uses the uppercase E. Thanks!
Comment 1 Gabriel Barrantes 2024-07-09 15:54:30 UTC
(In reply to S. Umar from comment #0)
> If I input 3.6434E+01 into kcalc it gives me "input error" but lowercase
> version  3.6434e+01 gvies 36.434. Uppercase is iseful when pasting from
> outputs (like fortran) which uses the uppercase E. Thanks!

I have never seen upper case for the E, are there any other use cases? it would be easy to add tho...
Comment 2 S. Umar 2024-07-09 18:53:55 UTC
Hi, I believe most FORTRAN compilers use the upper case. I am using the latetst Intel OneApi fortran compilers. One can code lower case e
but the output files have the upper case.
Comment 3 Bug Janitor Service 2024-07-16 23:47:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kcalc/-/merge_requests/123
Comment 4 Gabriel Barrantes 2024-07-16 23:48:45 UTC
(In reply to S. Umar from comment #2)
> Hi, I believe most FORTRAN compilers use the upper case. I am using the
> latetst Intel OneApi fortran compilers. One can code lower case e
> but the output files have the upper case.

It was supported in the old versions so I better just add it.
Comment 5 Gabriel Barrantes 2024-07-16 23:49:06 UTC
Git commit 6ccda46170a9b943f9f514f8fbaf85f7da424464 by Gabriel Barrantes.
Committed on 16/07/2024 at 23:43.
Pushed by gabrielbarrantes into branch 'master'.

Add parsing support for scientific notation numbers with capital E

M  +8    -0    autotests/kcalc_parser_core_test.cpp
M  +1    -1    kcalc_parser.cpp
M  +1    -1    knumber/knumber.cpp

https://invent.kde.org/utilities/kcalc/-/commit/6ccda46170a9b943f9f514f8fbaf85f7da424464
Comment 6 S. Umar 2024-07-17 14:11:45 UTC
I tested the master git (not committed to 24.05 branch yet) and the capital E exponents work now. Thanks.