Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fibonacci Matrix doesn't useBigInts #1047

Closed
Assignees
Rudxain
Labels
algorithmAdds or improves an algorithmfeatureAdds a new featurein progressBeing worked on
@Rudxain

Description

@Rudxain

This file usesNumbers at the matrix algorithm to compute the nth number in the Fibonacci sequence. My reasons to recommendBigInt are these:

  • BigInts can't useBinet's Formula, nor therounded 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 yieldshuge numbers,BigInts are more suitable for this task. UsingNumbers 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 algorithmfeatureAdds a new featurein progressBeing worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp