-
Jan 12th, 2023, 04:15 PM
#1
Thread Starter
PowerPoster
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
There are 10 kinds of people in this world. Those who understand binary, and those who don't.
-
Jan 12th, 2023, 05:57 PM
#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.
-
Jan 13th, 2023, 07:18 AM
#3
Thread Starter
PowerPoster
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).
There are 10 kinds of people in this world. Those who understand binary, and those who don't.
-
Jan 13th, 2023, 03:55 PM
#4
Thread Starter
PowerPoster
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!
There are 10 kinds of people in this world. Those who understand binary, and those who don't.
-
Jan 20th, 2023, 11:56 AM
#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.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|