]> www.ginac.de Git - cln.git/blobdiff - examples/contfrac.cc
* Change all C include headers to ISO style within C++ code.
[cln.git] / examples / contfrac.cc
index ba1e3d426dd884735024c74e3edb8440bc27b347..b80c6611676f3f0f8647a60afe2a2204ad3cdf49 100644 (file)
@@ -8,10 +8,11 @@
 #include <cln/io.h>
 #include <cln/integer_io.h>
 
+using namespace std;
 using namespace cln;
 
 // Our private error handling: return to the main program.
-#include <setjmp.h>
+#include <csetjmp>
 jmp_buf restartpoint;
 namespace cln {
        void cl_abort (void) { longjmp(restartpoint,1); }
@@ -27,23 +28,23 @@ int main (int argc, char* argv[])
                cl_R x = arg;
                // Check sign.
                if (minusp(x)) {
-                       stdout << '-';
+                       cout << '-';
                        x = -x;
                }
-               fprint(stdout, "[");
+               cout << "[";
                const char* separator = "; ";
                for (;;) {
                        // Split x into integral and fractional part.
                        cl_R_div_t x_split = floor2(x);
-                       stdout << x_split.quotient;
+                       cout << x_split.quotient;
                        x = x_split.remainder;
                        if (zerop(x))
                                break;
-                       stdout << separator;
+                       cout << separator;
                        separator = ", ";
                        // Invert x.
                        x = recip(x);
                }
-               stdout << ']' << std::endl;
+               cout << ']' << endl;
        }
 }