Convergents of a Continued Fraction
|
09-20-2024, 12:04 AM
Post: #4
|
|||
|
|||
RE: Convergents of a Continued Fraction
(03-13-2022 11:41 PM)Thomas Klemm Wrote: For example, here are the convergents for \([0;1,5,2,2]\). Just a visual explanation why OP setup only need to track 3 values on the stack. Scaling the entries does not change convergent ratios. h(n)/k(n) = w(n)/1, and we don't need to store denominator 1 Code: a(n) 0 1 5 2 2 But, there is a cost. Convergent integer ratio is lost, only its value remained. Also, a1≠0 is required, because we can't scale denominator of 0 to 1. Also, we can't start with a0 alone, because k(-1)=0, unable to scale to 1 |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Convergents of a Continued Fraction - Thomas Klemm - 03-13-2022, 11:41 PM
RE: Convergents of a Continued Fraction - Albert Chan - 09-18-2024, 04:50 PM
RE: Convergents of a Continued Fraction - Albert Chan - 09-18-2024, 08:24 PM
RE: Convergents of a Continued Fraction - Albert Chan - 09-20-2024 12:04 AM
RE: Convergents of a Continued Fraction - Albert Chan - 09-20-2024, 05:27 PM
RE: Convergents of a Continued Fraction - C.Ret - 09-20-2024, 10:24 PM
RE: Convergents of a Continued Fraction - Thomas Klemm - 09-21-2024, 08:33 AM
|
User(s) browsing this thread: 2 Guest(s)