Lines Matching +full:long +full:- +full:term
1 // SPDX-License-Identifier: GPL-2.0
25 * (1 << 8) - 1, (1 << 5) - 1, &n, &d);
35 unsigned long given_numerator, unsigned long given_denominator, in rational_best_approximation()
36 unsigned long max_numerator, unsigned long max_denominator, in rational_best_approximation()
37 unsigned long *best_numerator, unsigned long *best_denominator) in rational_best_approximation()
48 * a is current term of the continued fraction. in rational_best_approximation()
50 unsigned long n, d, n0, d0, n1, d1, n2, d2; in rational_best_approximation()
57 unsigned long dp, a; in rational_best_approximation()
61 /* Find next term in continued fraction, 'a', via in rational_best_approximation()
70 * convergent), n2/d2, using the term just found and in rational_best_approximation()
78 * largest semi-convergent, the final term of which is in rational_best_approximation()
82 unsigned long t = ULONG_MAX; in rational_best_approximation()
85 t = (max_denominator - d0) / d1; in rational_best_approximation()
87 t = min(t, (max_numerator - n0) / n1); in rational_best_approximation()
89 /* This tests if the semi-convergent is closer than the previous in rational_best_approximation()
91 * is the 1st iteration, so always choose the semi-convergent. in rational_best_approximation()