Approximating rational numbers

Samuel A. Figueroa uunet!SPUNKY.CS.NYU.EDU!figueroa
Mon Jul 27 22:05:27 PDT 1992


I am wondering if anyone has developed an algorithm for finding the floating-
point number closest to the quotient of two integers, both of which may have
arbitrary length.  Such an algorithm would be useful in an ideal implementa-
tion of the Ada language.  (NYU is working on an Ada compiler to be distri-
buted as part of the GNU "cc system."  I suspect this compiler will have nice
floating-point facilities.)  I am trying to come up with an algorithm for this
purpose, and I suspect this problem is similar to that of converting decimal
strings to binary floating-point numbers.  If someone already knows of an
algorithm, this could save me some work.

Sam



More information about the Numeric-interest mailing list