: : You said that you are getting overflow in N?
: : Have you tried allocating more memory to your variables?
: : Or if you are saying that you are just getting an overflow on your stack, then you are going to have to find a way to break your code down into more than one line. Work in smaller steps and sometimes you can handle larger numbers.
: :
: : I've run into that problem once and I had to split my equation into a high order and low order ends. This can be really hard to do in your head, but if you stick in a couple extra steps, the high end can be cut out by like /100000 and the low end would be the difference. Then the multiplicative distribution law applies to both the high order and low order, and anything like the additive distribution law would only apply to the order that it deals with. Then any overflow from the low order end can be handled by your code and transfered to the high order end.
: :
: :
: : ></\/~Psightoplasm`~
: :
: :
: my equation is B = A^n/n!/(A^1/1!+A^2/2!+A^3/3!+------+A^n/n!)
: in the most simplest form of this equation i need to get the factorial of 666! and A^666
: i m worry becaz i have to submit it at 12th of next month
:
:
:
If you are scripting in java, why place a message in this board.
if you are actually using java, I can't help you
anywayz, this is my solution for VB:
dim c, d as long
Public Sub Factorial(a as long, n as long)
c = a^n/n!
d = 0
for i = 1 to n
d = d + ( a / i / i! )
next i
b = c / d
msgbox b
End Sub
let me know if it worx...
EtHeO out...