Posted 23 May 2005 - 12:00 AM
3) Brute force (best match) approach, use: exact2(value,precision)
The above is fast enough (15s) only for p>=0.01. Things would be MUCH faster even in Basic (CFX version I wrote some time ago is faster even though it displays partial matches). The problem is, Basic program on Classpad would be less useful, because you can't run Basic in Main. Of course, hardcoded function would be even better.
Pi is the only interesting number I know that has SO good precision at 355/113. Most of the non-fractional real numbers do not have fractional approximations that would be significantly (orders) better than decimal fraction up to the needed precision (compared to denominator)... This could be probably proven... anyone? So usefulness of exact(val,prec) function is questionable.
Just my two cents...