# Thread: C# question but also it's math!

1. ## C# question but also it's math!

A coworker asked me if I could run a formula for him and he gave it to me like this: (-1.75*.35^2*.35+3.067167)*.35^1.5
Since C doesn't have that exponentiation operation I rewrote it with Math.Pow but I am not sure of the correct parenthesis placement.
Is this equivalent?
?(-1.75* Math.Pow(.35,2) *.35+3.067167)*Math.Pow(.35,1.5)
0.61955998366026122

2. ## Re: C# question but also it's math!

That's how I would interpret the formula as written.

That being said, it is a bit odd that he's got .35^2*.35, since that would just be .35^3. If his intention was to raise the first .35 to the power of (2*.35) or even (2*.35+3.067167), then he should have included parenthesis indicating that.

3. ## Re: C# question but also it's math!

Thank you. I sent this link to him so he can look at the thread. I believe he received this calc from someone else, his customer. It's for water levels in a dam (weirs).

4. ## Re: C# question but also it's math!

OK, he said he has it working/is getting the correct results. I will talk to him next week to find out his solution. Thank you!

5. ## Re: C# question but also it's math!

Presumably, there are a few variables in there. Seeing the original, with the variables, would probably clarify to some extent. After all, if there are no variables, then there isn't a whole lot of point in the computer doing the math at runtime. It could just be pre calculated and used as a constant.

Had the variables been in the equation, it likely would have been clear.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•