Roots

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am developing a new program using Visual C# 2005 Express Edition Beta 1.
One of the functions is as follows:

public decimal Root(decimal Number, ulong Root)
{
// If n = Root, calculate the nth root of Number here
}

What do I use to replace the comment in the above function?
 
public decimal Root(decimal Number,ulong Root)
{
//the type "decimal" and "ulong" made me uncomfortable
return (decimal)Math.Pow((double)Number,1/(double)Root);
}
 
Back
Top