I'm having trouble finding the operators for calculating square roots as well as exponents. The C++ operator, sqrt, doesn't work in C# so I've tried raising to the 1/2 power but still with no success.Here's a code snippet incase I'm doing something completely wrong.
float A = float.Parse(aValue.Text);
float B = float.Parse(bValue.Text);
float C;
C = ((A * A) + (B * B)) ^ (1/2);
This is obviously for solving the Pathiagorean Theorem. Any help would be greatly appreciated.
Question
rafter109
I'm having trouble finding the operators for calculating square roots as well as exponents. The C++ operator, sqrt, doesn't work in C# so I've tried raising to the 1/2 power but still with no success.Here's a code snippet incase I'm doing something completely wrong.
float A = float.Parse(aValue.Text);
float B = float.Parse(bValue.Text);
float C;
C = ((A * A) + (B * B)) ^ (1/2);
This is obviously for solving the Pathiagorean Theorem. Any help would be greatly appreciated.
Link to comment
Share on other sites
3 answers to this question
Recommended Posts