Setting a maximum demoninator for fractions
|
10-04-2023, 06:20 PM
(This post was last modified: 10-05-2023 12:54 PM by Albert Chan.)
Post: #13
|
|||
|
|||
RE: Setting a maximum demoninator for fractions
(10-04-2023 04:59 PM)Albert Chan Wrote: We pick smaller denominator convergent, if product of 2 DOT's ≥ 0: But wait! s = sign(x - n1/d1), we don't need to track it! LHS always negative, we multiply by -1, for equivalent test. abs(q*(n2 - (d1-d2)*x)) ≤ 1/2 CF, version 4 Code: EXPORT CF(x, dmax) // closest fraction |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)