New
#1
Windows 7 Calculator - Question on the logic for executing functions
Hi,
When we perform following operation on Win 7
Scenario 1
(9.1*10^ - 31*3*10^8) =
we can see the equation getting formed in following way:
what we see on the screen is this
(9.1*(10- 31*3*10^8))
and result on = comes to following
-84629999909
I would like to know on pressing - sign after ^ windows seems to replace the ^ operation with - operation. And when it does that it fails to compute the 9.1*10. To explain, if you execute same math equation with ^ sign i.e. as below:
Scenario 2
(9.1*10 - 31*3*10^8) =
window shows result as 91 the moment you input - operation in sequence.
I predict the same behavior even for the equation where user inputs - sign immediately followed by ^ sign. If window is replacing the - operation with ^ then logically it should do the same what I have explained above in Scenario 2.
Not sure what different logic windows is applying here. When I try to execute same logic on JEP Parser (Jep Console - DJep/JEP Java Math Expression Parser) this is what JEP gives as result:
JEP > (9.1*10 - 31*3*10^8)
-9.299999909E9
It seems there is a bug in the way Windows 7 replaces operation but forgets to execute its preceding operation, even though the precedence of previous operation is HIGH as compared immediate next operation.
Let me know if any one observed similar issue and what could be the correct way of implementation here.
Thanks in advance.
Abdul