Can anyone suggest a quick workaround for this possible bug, or a fix?



Dan,

You would like rat(2.5e-6) with ratepsilon:1e-2 to be 1/400000 rather
than 1/399999 (as it is today).

I understand the motivation, but it does bring up the question: what
exactly is the correct definition of rat(x) with a given eps?

The obvious answer is "the smallest fraction within the range
(1-eps,1+eps)*x".  But that would give 1/396040 = 2.525e-6....  Should
it be instead "the most accurate fraction whose denominator is within
a factor of 1.9 of the smallest such fraction", say?

What should rat(7.5e-6) be with eps=1e-2? 3/400000 or 1/133333 or
1/132014?  How about rat(7.53767e-6)?

         -s