954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how can I get a root of some number

I want get a root of number in C#
what library i must to insert and what command solve it

polo_coins
Junior Poster in Training
63 posts since Oct 2008
Reputation Points: 8
Solved Threads: 0
 
System.Math.Sqrt();
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
 

thanks a lot

polo_coins
Junior Poster in Training
63 posts since Oct 2008
Reputation Points: 8
Solved Threads: 0
 

In addition to that : a root of a number cannot only refer to the square root, but also the cube root,... Nth root.
To do this in C# you can do something like:

double num = 8.0;
double power = 1.0 / 3;
Console.WriteLine("Cube root of {0} is {1}.", num, Math.Pow(num, power));
ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: