Friday, July 31, 2009

To use pow function in C# , which namespace is to be added in the beginning?

You don't need to import anything, or adjust the namespace of your application. The pow function is a static method (as are most if not all methods in this class) of the Math class. Ex:





double result = Math.pow(5, 2);





result would equal 25. Note that the return is a double.


No comments:

Post a Comment