Skip to main content
Post Made Community Wiki
Source Link
Andreas Blass
  • 73.1k
  • 8
  • 191
  • 290

Here's a lower-level but still useful application. A student came to me with some computer-produced 10-digit (maybe more than 10, I don't remember exactly) floating-point numbers, which I suspected were actually (approximations to) some fairly reasonable rational numbers (with denominators in the 3- or 4-digit range). A way to get those rational numbers, if they exist, is to start computing the continued fraction expansion of the floating-point numbers, until you get an exceptionally large denominator. Then pretend that denominator is $\infty$, i.e., truncate the continued fraction at that point.