Exceladd1ct
Board Regular
- Joined
- Feb 10, 2019
- Messages
- 76
Hello,
I wrote a piece of code that would generate fibonacci sequence, but there is no data type that can hold such big numbers, is there a workaround to make the code contiune to do the math with big numbers?
Thanks.
I wrote a piece of code that would generate fibonacci sequence, but there is no data type that can hold such big numbers, is there a workaround to make the code contiune to do the math with big numbers?
Thanks.
VBA Code:
Option Explicit
Sub Fibonacci()
Dim i As LongPtr, k As LongPtr
i = 0
k = 1
Debug.Print i
Debug.Print k
Dim x As LongPtr, q As LongPtr, j As LongPtr, a As Long
x = i + k 'x = 0+1
q = x + k 'q = 1+1
j = x + q 'j = 1+2
Debug.Print k
Debug.Print j
For a = 1 To 1000
x = q
q = j
j = x + q
Debug.Print j
Next
End Sub