Bug 240082 - X*10^Y (negative number) don't work
Summary: X*10^Y (negative number) don't work
Status: RESOLVED WORKSFORME
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: 0.9
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Klaus Niederkrüger
URL:
Keywords:
: 347604 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-30 14:22 UTC by Dj YB
Modified: 2015-05-12 13:38 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dj YB 2010-05-30 14:22:26 UTC
Version:           0.9 (using KDE 4.4.2) 
OS:                Linux

there is no way to do a*10^-b or 3e-2
it simply ignores the operation

Reproducible: Always

Steps to Reproduce:
try 3e-2 or 3 X*10^Y -1

Actual Results:  
ignoring the e operation at all and doing the -b

Expected Results:  
a*10^-b = a/(10^b)

OS: Linux (i686) release 2.6.33.4-95.fc13.i686.PAE
Compiler: gcc
Comment 1 Alexey Shildyakov 2010-05-30 16:18:11 UTC
Why a*10^-b is a/(10^b)? I think it should be 1/((a * 10)^b).
Comment 2 Dj YB 2010-05-30 16:29:32 UTC
LOL my mistake. you are right.
a^-b = 1/(a^b)
Comment 3 Dj YB 2010-05-30 17:32:41 UTC
re-reading what I posted earlier, 

Expected Results:  
a*10^-b = a/(10^b)

that is correct.

if you write 5e-3 which is 5*10^-3 you mean 5/1000 or 0.005 and not 
1/((a * 10)^b) which in this case would be 1/((5 * 10)^3)=1/(50^3)=1/125000 as written in comment #1
Comment 4 Alexey Shildyakov 2010-05-30 17:40:40 UTC
5e-3 is a standard of representing number so only one interpretation must be.
a*10^-b in math is (a * 10) ^ (-b). It's depend on what priority of making operation.
Comment 5 Dj YB 2010-05-30 19:17:33 UTC
please try to put that expression 5*10^-3 in Google for example... or any pocket calculator that allow entering the whole operation.
tell me which one you got, 0.005 I guess.
Comment 6 Alexey Shildyakov 2010-05-30 19:30:03 UTC
Yes. It's ok because the operation ^ (pow) has the higher priority than * (mult).
Comment 7 Christoph Feck 2010-05-30 23:45:55 UTC
With the mouse: "5" "x*10^y" "3" "+/-" "="
With the keyboard: "5" "e" "3" "\" "="

In both cases, I get "0.005".

"\" is documented as the "change sign" keyboard shortcut in the handbook.
Comment 8 Dj YB 2010-05-31 07:21:08 UTC
why can't it be just like any other calculator? why the need for different convention?
this is not intuitive, and with all the respect, I don't believee that I would have to read a manual\documentation to operate a calculator.
Comment 9 Christoph Feck 2010-05-31 12:28:22 UTC
The aim was to emulate how a desktop calculator worked at the time it was written. Those had separate "-" and "+/-" keys, and the key to change the sign of a number only worked AFTER you typed the number.

Of course, today's calculators are different. If you want to help modernize kcalc, please provide patches.
Comment 10 Dj YB 2010-05-31 14:06:50 UTC
well, as much as I like programming this is inventing the wheel for no good reason.
I have installed and now testing gcalctool 5.30.1 under FC13 kde 4.4.2 and it runs perfectly and provide better (in my opinion) and more intuitive approach.
so far I see more functionality in gcalctool then in kcalc, and no reason why not using it over kcalc.
so I think I'll simply stick with it.

best regards.
Comment 11 Christoph Feck 2015-05-12 13:38:57 UTC
*** Bug 347604 has been marked as a duplicate of this bug. ***