Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Formula Evaluation

Former Member
0 Likes
664

Hi Experts,

Can any one give suggestion for that

user gives formula that have all arthimatic operators and trignometric also may have

how to evaluate that and how to get the solution

formula is like

( a + b ) * ( c / b ) sin(60) + tan(45) .

in this how to get what operator is first and what operator is next

Thanks

Surendra Reddy

5 REPLIES 5
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
634

check this thread.

im not sure how much it will help you in scientific calculations

try with input.

2 + ( 3 * 6 ) + SIN(60) + TAN(45)

Edited by: Keshu Thekkillam on Oct 9, 2009 1:03 PM

Read only

Former Member
0 Likes
634

you can.

SIN( 30 )
TAN( 45 ).

see there is a space between bracket and the number

like

abc = 2 * sin( 30 ).

and you total formula follows the normal mathematical order.

brackets, division, multi, plus, minus etc..

Read only

Former Member
0 Likes
634

Hi

What Soumyaprakash told is wrong. There are some operator precedence being followed while calculating the expression.

In the expression: ( a + b ) * ( c / b ) sin(60) + tan(45), it executes in the below order

1) c/b

2) (result of step 1) * sin(60)

3) a+b

4) (result of step 3) * (result of(step 2)

5) result of step 4 + tan(45)

Regards

Rajvat

Read only

0 Likes
634

raj, what did i say wrong ?

Read only

0 Likes
634

Hi Soumya

I meant that the concept behind calculation is as per mathematical precedence rule.

Rajvat