Roots

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • psduckie

    Roots

    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?
  • Alan Pretre

    #2
    Re: Roots

    "psduckie" <psduckie@discu ssions.microsof t.com> wrote in message
    news:8C4F2D1B-459D-4856-AC5D-2C608BCECD18@mi crosoft.com...[color=blue]
    > What do I use to replace the comment in the above function?[/color]

    Uh... this wouldn't happen to be a homework assignment, would it?

    -- Alan


    Comment

    • Liu Xia

      #3
      RE: Roots

      public decimal Root(decimal Number,ulong Root)
      {
      //the type "decimal" and "ulong" made me uncomfortable
      return (decimal)Math.P ow((double)Numb er,1/(double)Root);
      }

      "psduckie" wrote:
      [color=blue]
      > 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?[/color]

      Comment

      Working...