4 ms·
Everything else is talking about bigints. If you were dealing with fixed-length integers, just use a lookup table. Also, you're wrong regarding floating-point
by TheLoneWolfling 12y ago
Everything else is talking about bigints.
If you were dealing with fixed-length integers, just use a lookup table.
Also, you're wrong regarding floating-point. On my machine, fib(101) is off from your approximation by ~2 million (!). Well before hitting the limits of a 64-bit float. It starts erroring at n=71, and only gets worse from there. Worse, the relative delta grows as n increases.
- osoba 12y agoHmm ok Thanks for actually testing it
- TheLoneWolfling 12y agoPython is wonderful for that sort of thing.