]> www.ginac.de Git - cln.git/blobdiff - src/float/transcendental/cl_LF_cossin_aux.cc
* */*: Convert encoding from ISO 8859-1 to UTF-8.
[cln.git] / src / float / transcendental / cl_LF_cossin_aux.cc
index 32d0b77e85aff2573ef8be642e1c6694ba822567..86e630d300d75161ef7e75664adb7363bbec8d2a 100644 (file)
@@ -14,7 +14,7 @@
 #include "cl_LF.h"
 #include "cln/integer.h"
 #include "cl_alloca.h"
-#include "cln/abort.h"
+#include "cln/exception.h"
 
 #undef floor
 #include <cmath>
@@ -26,11 +26,11 @@ namespace cln {
 // by a power series evaluation brings 20% speedup, even more for small lengths.
 #define TRIVIAL_SPEEDUP
 
-const cl_LF_cos_sin_t cl_cossin_aux (const cl_I& p, uintC lq, uintC len)
+const cl_LF_cos_sin_t cl_cossin_aux (const cl_I& p, uintE lq, uintC len)
 {
  {     Mutable(cl_I,p);
-       var uintC lp = integer_length(p); // now |p| < 2^lp.
-       if (!(lp <= lq)) cl_abort();
+       var uintE lp = integer_length(p); // now |p| < 2^lp.
+       if (!(lp <= lq)) throw runtime_exception();
        lp = lq - lp; // now |p/2^lq| < 2^-lp.
        // Minimize lq (saves computation time).
        {
@@ -112,7 +112,7 @@ const cl_LF_cos_sin_t cl_cossin_aux (const cl_I& p, uintC lq, uintC len)
        #else // TRIVIAL_SPEEDUP
        var cl_LF cossum = sqrt(cl_I_to_LF(1,actuallen) - square(sinsum));
        #endif
-       return cl_LF_cos_sin_t(shorten(cossum,len),shorten(sinsum,len)); // verkürzen und fertig
+       return cl_LF_cos_sin_t(shorten(cossum,len),shorten(sinsum,len)); // verkürzen und fertig
 }}
 // Bit complexity (N = len, and if p has length O(log N) and ql = O(log N)):
 // O(log(N)*M(N)).