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);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top