How to find the closest bounded rational approximation to a rational number?

114 Views Asked by At

Say I have a rational number $a/b$ and I want to find its closest rational approximation $x/y$ where $$x_- \leq x \leq x_+$$ $$y_- \leq y \leq y_+$$ for some constants $x_\pm$, $y_\pm$. How can I compute the integers $x$ and $y$ efficiently, given the rest?

1

There are 1 best solutions below

1
On