Definition:Best Rational Approximation

Definition
Let $x \in \R$ be an (irrational) real number.

The rational number $a = \dfrac p q$ is a best rational approximation to $x$ :


 * $(1): \quad a$ is in canonical form, that is $p$ is coprime to $q$: $p \perp q$


 * $(2): \quad \left\vert{x - \dfrac p q}\right\vert = \min \left\{ {\left\vert{x - \dfrac {p'} {q'} }\right\vert: q' \le q}\right\}$

That is:
 * $\left\vert{x - \dfrac p q}\right\vert$ is smaller than for any $\dfrac {p'} {q'}$ where $q' \le q$

where $\left\vert{x}\right\vert$ denotes the absolute value of $x$.