]> www.ginac.de Git - cln.git/commitdiff
* Update a little.
authorRichard Kreckel <kreckel@ginac.de>
Fri, 11 Jan 2008 17:16:15 +0000 (17:16 +0000)
committerRichard Kreckel <kreckel@ginac.de>
Fri, 11 Jan 2008 17:16:15 +0000 (17:16 +0000)
examples/e.cc
examples/fibonacci.cc
examples/pi.cc

index e1675769fee2aefa964e6ab30f14d907635e51f9..9aa7c632f6c9fca47fef626cf504a92bd0208f8c 100644 (file)
@@ -43,7 +43,7 @@ using namespace std;
 using namespace cln;
 
 void
-sum_exp1 (uintL a, uintL b, cl_I & first, cl_I & second)
+sum_exp1 (uintC a, uintC b, cl_I & first, cl_I & second)
 {
   switch (b - a)
     {
@@ -60,7 +60,7 @@ sum_exp1 (uintL a, uintL b, cl_I & first, cl_I & second)
     default:
       {
         cl_I lp, lq, rp, rq, tmp;
-        uintL mid = (a + b) >> 1;
+        uintC mid = (a + b) >> 1;
         sum_exp1 (a, mid, lp, lq);
         sum_exp1 (mid, b, rp, rq);
         tmp = lp * rq;
@@ -76,14 +76,14 @@ namespace cln {
 }
 
 void
-const_exp1 (cl_LF & result, uintL dec)
+const_exp1 (cl_LF & result, uintC dec)
 {
-  uintL c = (uintL) (dec * ::log (10));
-  uintL n = dec;
+  uintC c = (uintC) (dec * ::log (10));
+  uintC n = dec;
   uintC actuallen = (uintC)(3.321928094 * dec / intDsize);
-  n = (uintL) ((n + c) / ::log ((double)n));
-  n = (uintL) ((n + c) / ::log ((double)n));
-  n = (uintL) ((n + c) / ::log ((double)n));
+  n = (uintC) ((n + c) / ::log ((double)n));
+  n = (uintC) ((n + c) / ::log ((double)n));
+  n = (uintC) ((n + c) / ::log ((double)n));
 
   n += 2;
   actuallen += 2;
@@ -100,10 +100,10 @@ const_exp1 (cl_LF & result, uintL dec)
 int
 main (int argc, char *argv[])
 {
-  int digits = 100;
+  long digits = 100;
   while (argc >= 3) {
         if (!strcmp(argv[1],"-n")) {
-            digits = atoi(argv[2]);
+            digits = atol(argv[2]);
             argc -= 2; argv += 2;
             continue;
         }
index df975125ff41fb885a5fdb7eb73f03f4d2df3c72..57e014a8be908eba87a946a4d369ab3fec5c831d 100644 (file)
@@ -88,7 +88,7 @@ const cl_I fibonacci_compact (int n)
        cl_I u = 0;
        cl_I v = 1;
        cl_I m = n/2; // floor(n/2)
-       for (uintL bit=integer_length(m); bit>0; --bit) {
+       for (uintC bit=integer_length(m); bit>0; --bit) {
                // Since a squaring is cheaper than a multiplication, better use
                // three squarings instead of one multiplication and two squarings.
                cl_I u2 = square(u);
index ce82bb822e8ceb9dec4b9f84f5e662b727ebcfcf..d8b310f372416be20808c73156fa62e19ef1c2fa 100644 (file)
@@ -3,6 +3,7 @@
 #include <cln/output.h>
 #include <cln/real.h>
 #include <cln/real_io.h>
+#include <cln/version.h>
 #include <cctype>
 #include <cstdlib>
 #include <cstring>
@@ -31,10 +32,12 @@ main (int argc, char * argv[])
                        return 0;
                }
                if (argc == 2 && !strcmp(argv[1],"--version")) {
-                       cout << "pi (cln) " << CL_VERSION_MAJOR << "." << CL_VERSION_MINOR << endl;
-                       cout << "Written by Bruno Haible." << endl;
+                       cout << "pi (CLN "
+                            << version_major << "." << version_minor << "." << version_patchlevel
+                            << ")" << endl;
+                       cout << "Written by Bruno Haible and Richard B. Kreckel." << endl;
                        cout << endl;
-                       cout << "Copyright (C) 1998-2008 Bruno Haible, 2000-2008 Richard B. Kreckel." << endl;
+                       cout << "Copyright (C) 1988-2008 Bruno Haible, 2000-2008 Richard B. Kreckel." << endl;
                        cout << "This is free software; see the source for copying conditions.  There is NO" << endl;
                        cout << "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." << endl;
                        cout << endl;