1 // Print the continued fraction of a real number.
3 // We work with real numbers and integers.
5 #include <cln/integer.h>
9 #include <cln/integer_io.h>
14 int main (int argc, char* argv[])
16 for (int i = 1; i < argc; i++) {
17 const char * arg = argv[i];
19 // Convert argument to its internal representation:
27 const char* separator = "; ";
29 // Split x into integral and fractional part.
30 cl_R_div_t x_split = floor2(x);
31 cout << x_split.quotient;
32 x = x_split.remainder;
41 } catch ( const runtime_exception& ) {}