Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

factorials or integrals

Status
Not open for further replies.

shanley06

Programmer
Nov 26, 2002
101
US
i wanted to know if someone could show me how to make a funtion that will evaluate integrals for me. if not is there a way i can do factorials in qbasic? i want to make gamma and beta funtions, and the only two ways i know how to find gamma and beta for gamma(n) and b(m,n) are to use factorials or integrals. i tried to make my own function to the factorial of a number, but it was extremely slow and could only find the factorial of any whole number>1 and i want to be able to find the factorials of numbers such as .5 also
 
oh to find that factorial i know that n!~e^(-n)n^n*sqrt(2 pi n), but i want somethin more accurate than that
 
There is a book called Numerical Recipes.
Electronic version is available at
So there you probably could found the algorithms you looking for.

The only thing is that the programs available there are written in C, Fortran 77 and Fortran 90.
But I hope you could figure it out (at least the idea). I personally get spline interpolation from there re-coded in Basic without understanding underlying math ;)
 
Good call tsh73,

I was fixing to post the same thing...

Shanley06,

If you find what you are looking for on that site, and have trouble converting it...

You can post the C/C++ code here and I will help you convert it from C to QB...

Good Luck

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top