Is it possible to find closest number to a given irrational one, which is obtained by dividing 2 numbers in a given range faster than O(n^2)?

Let's say I have a range from 11 to 99 I need to find:

abs(a/b)-k = min, a nd b - integer, k-an irrational number


I can just look at all pairs of numbers in quadratic time

for(i=11;i<99;++i)
for(j=i;j<99;++j)
abs()...


and find the minimum, but is it possible to do this in linear time, for example?

• Your question does not appear to be a research-level question in theoretical computer science. For more information about the scope, please see help center, cstheory.stackexchange.com/help/on-topic. Your question might be suitable for Computer Science which has a broader scope, cs.stackexchange.com. yesterday