Lines Matching +full:long +full:- +full:term
1 // SPDX-License-Identifier: GPL-2.0
26 * (1 << 8) - 1, (1 << 5) - 1, &n, &d);
36 unsigned long given_numerator, unsigned long given_denominator, in rational_best_approximation()
37 unsigned long max_numerator, unsigned long max_denominator, in rational_best_approximation()
38 unsigned long *best_numerator, unsigned long *best_denominator) in rational_best_approximation()
49 * a is current term of the continued fraction. in rational_best_approximation()
51 unsigned long n, d, n0, d0, n1, d1, n2, d2; in rational_best_approximation()
58 unsigned long dp, a; in rational_best_approximation()
62 /* Find next term in continued fraction, 'a', via in rational_best_approximation()
71 * convergent), n2/d2, using the term just found and in rational_best_approximation()
79 * largest semi-convergent, the final term of which is in rational_best_approximation()
83 unsigned long t = ULONG_MAX; in rational_best_approximation()
86 t = (max_denominator - d0) / d1; in rational_best_approximation()
88 t = min(t, (max_numerator - n0) / n1); in rational_best_approximation()
90 /* This tests if the semi-convergent is closer than the previous in rational_best_approximation()
92 * is the 1st iteration, so always choose the semi-convergent. in rational_best_approximation()