Rational approximation to a decimal number

Find the best rational approximation to a decimal number, given a maximum denominator size.

Value x to approximate, 0 < x < 1:
Largest possible denominator:

Best approximation ...

See algorithm details here.

 

John D. Cook photo

Is there anything else I can help you with?