Re: [PATCH] lib: Fix possible incorrect result from rational fractions helper

2019-04-03 Thread tpiepho
On Mon, Apr 1, 2019 at 10:22 PM Andrew Morton < a...@linux-foundation.org> wrote: > On Sat, 30 Mar 2019 13:58:55 -0700 Trent Piepho > wrote: > > In some cases the previous algorithm would not return the closest > > approximation. This would happen when a semi-convergent was the > > closest, as

Re: [PATCH] lib: Fix possible incorrect result from rational fractions helper

2019-04-01 Thread Andrew Morton
On Sat, 30 Mar 2019 13:58:55 -0700 Trent Piepho wrote: > In some cases the previous algorithm would not return the closest > approximation. This would happen when a semi-convergent was the > closest, as the previous algorithm would only consider convergents. > > As an example, consider an

[PATCH] lib: Fix possible incorrect result from rational fractions helper

2019-03-30 Thread Trent Piepho
In some cases the previous algorithm would not return the closest approximation. This would happen when a semi-convergent was the closest, as the previous algorithm would only consider convergents. As an example, consider an initial value of 5/4, and trying to find the closest approximation with