3 ms·
Why does factorial(21) equal -4249290049419214848?
- MaysonL 14y agoFactorial, not fib
- adambom 14y agoWhoops.
- gordaco 14y agoAlthough fib grows exponentially, so it does the same for not so big numbers (a back-of-an-envelope calculation gives me that fib(91) doesn't fit in 63 bits). OTOH, if I had to calculate fib(X), and not fib(1..X), I'd use the exponential formula (relying on floating point) instead of the recurrence (which uses integer), so I guess the error would be detected at the conversion to integer.