A sample for arithmetical expression evaluation

Filippo

Expert
Licensed User
Hi coldraymagic,

i think the bills are not right. ;)


Ciao,
Filippo
 

Attachments

klaus

Expert
Licensed User
I agree with Filippo, unfortunately your math evaluator doesn't take into account the order of operations Order of operations - Wikipedia, the free encyclopedia !

In Filippo's examples:
sqrt(9) + 2 ^ 2 = 3 + 4 = 7 and not 25
the sqrt operation AND the ^ operation must be executed before the + operation !
your calculation is equivalent to
(sqrt(9) + 2) ^ 2 = 25

Best regards.
 
Last edited:

Rioven

Active Member
Licensed User

klaus

Expert
Licensed User
Hi Rioven,

Thank's for the 'bug report', I corrected the value in my post.
It seems that I was more concentated on the principle rather than on the result? But anyway this one must be correct !

Best regards.
 
Top