Slaine
Slaine

Reputation: 41

C# & VSAEngine - Calculating a string expression with a exponent?

i've a prob here, so i need a help:)

When i'm calculating expression like this "(10.5 + 3.5 / 2) * 2" with jscript vsa engine, it's ok, but now i 've a question... if in the string like above, i want to calculate also an exponent (10.5 + 3.5 / 2) * 2 + exp(2), what is the best way to do it?

PS: Math.Exp(); -- is not an option.

Upvotes: 1

Views: 511

Answers (2)

vittore
vittore

Reputation: 17579

If you are using jscript.net you can define exp function first and calculate expression after that. example was discussed for instance there

Upvotes: 1

user906780
user906780

Reputation:

proper way to code this is to make your calculations in integer and then Convert.ToString() it

Upvotes: 1

Related Questions