Simple math in C++: Difference between revisions
No edit summary |
|||
| Line 67: | Line 67: | ||
float myValue=25, myResult; | float myValue=25, myResult; | ||
myResult = sqrt(myValue); // Squareroot the variable myValue, and store it into variable myResult | myResult = sqrt(myValue); // Squareroot the variable myValue, and store it into variable myResult | ||
myResult = pow( | myResult = pow(myResult,2.00); // Square the variable myResult, and then store it back into myResult | ||
</pre></code> | </pre></code> | ||