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

Recommended Answers

All 3 Replies

System.Math.Sqrt();

thanks a lot

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));
commented: Cave ab homine unius libri. +13
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.