- #1
madmike159
Gold Member
- 371
- 0
VB6 Help out of stack"
I was writing a program to work out factorials of large numbers. The doubble varible over flows at 9E+308. I work out some of the factorial then move to another subroutine and divide by ten until it is < 10 then continue timising it by integers. In the end I am left with a decimal number < 10 and another number which represents the exponant.
If I try to find the factorial of a very large number (200000+) it gives me an error "out of stack space", which I think is because it creats a stack to keep track of when you move between subroutine. I use the Call command, does anyone know a different command or a way to stop it running out of stack space?
Thanks
I was writing a program to work out factorials of large numbers. The doubble varible over flows at 9E+308. I work out some of the factorial then move to another subroutine and divide by ten until it is < 10 then continue timising it by integers. In the end I am left with a decimal number < 10 and another number which represents the exponant.
If I try to find the factorial of a very large number (200000+) it gives me an error "out of stack space", which I think is because it creats a stack to keep track of when you move between subroutine. I use the Call command, does anyone know a different command or a way to stop it running out of stack space?
Thanks