Google site:sulprobil.com [search items] to look around here
Compute nearest rational number to a given floating point number with a given maximal denominator