-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
algorithmAdds or improves an algorithmAdds or improves an algorithmfeatureAdds a new featureAdds a new featurein progressBeing worked onBeing worked on
Description
This file uses Number
s at the matrix algorithm to compute the nth number in the Fibonacci sequence. My reasons to recommend BigInt
are these:
BigInt
s can't use Binet's Formula, nor the rounded and simpler variant because that requires arbitrary-precision floating-point computation- The repeated-addition algo is more suitable for generator functions, but the matrix algo is used to get as fast as possible to the nth term in the sequence, regardless of the exponent value, without sequentially "touching" every term in the sequence
- Exponentiation (matrix or not) usually yields huge numbers,
BigInt
s are more suitable for this task. UsingNumber
s would usually returnInfinity
- All numbers used are integers, no need for floating-point or fixed-point
I want to make a PR, but I opened this issue to wait for approval
Metadata
Metadata
Assignees
Labels
algorithmAdds or improves an algorithmAdds or improves an algorithmfeatureAdds a new featureAdds a new featurein progressBeing worked onBeing worked on