473,394 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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?
Nov 17 '05 #1
2 1537
"psduckie" <ps******@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
What do I use to replace the comment in the above function?


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

-- Alan
Nov 17 '05 #2
public decimal Root(decimal Number,ulong Root)
{
//the type "decimal" and "ulong" made me uncomfortable
return (decimal)Math.Pow((double)Number,1/(double)Root);
}

"psduckie" wrote:
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?

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Richard Hollenbeck | last post by:
I'm sure there's a good explanation, but I haven't seen it in any of the documentation. When I query the mysql database in the user table I see two roots--one with the host as "localhost" and the...
5
by: Justin Caldicott | last post by:
Hi There are n solutions to the nth root of any number, eg: (-8)^(1/3) = 1 + sqrt(3)i or -2 or 1 - sqrt(3)i The following code:
2
by: temper3243 | last post by:
Hi, I have been trying to solve the problem Roots of the polynomial 038 from mipt.ru (el judge). I have failed to do so. I tried to search on the net but found about contour integrals for...
0
by: Raymond L. Buvel | last post by:
If you are using the root finder in Numeric, and are having problems, check out the root finder in the ratfun module. My testing indicates that it will give the exact roots of a Wilkinson...
3
by: Carl Johansen | last post by:
I have a big ASP website (used by several thousand car dealers) that is a collection of lots of small and medium-sized applications. Now I want to start adding ASP.NET applications to it. I have...
18
by: anand | last post by:
*********************************************************************************************************** #include<stdio.h> #include<conio.h> #include<math.h> void main() { double...
8
by: aruna | last post by:
to write a c program to find the roots of the equation using bisection method that too using array or pointers
2
by: =?ISO-8859-1?Q?Sch=FCle_Daniel?= | last post by:
Hello NG, given this call to roots funtion from pylab In : roots() Out: array() as far as I understand it stands for a0+a1*x+a2*x^2 in the above case it yields 2x^2+2x = 2x(1+x) and the...
1
by: candacefaye1 | last post by:
1. write a C++ program to decide if the coefficients of a quadratic equation have real roots. The three choices will be to write the message “zero divide” when A is zero, write the message “no real...
2
by: Peng Yu | last post by:
Hi, I have the following program which computes roots of a cubic function. The solution is sensitive to the type, which is due to the truncation error. 'long double T' gives three solutions, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.