]> www.ginac.de Git - cln.git/blobdiff - include/cln/float.h
Assume types 'long long int' and 'long double' exist.
[cln.git] / include / cln / float.h
index 2f0a58ce4b51076d66202a401bd377e2e76553f8..0af74e530b2a41be272792399dd8185175fbe911 100644 (file)
@@ -173,12 +173,10 @@ inline const cl_F operator+ (const long x, const cl_F& y)
        { return cl_I(x) + y; }
 inline const cl_F operator+ (const unsigned long x, const cl_F& y)
        { return cl_I(x) + y; }
-#ifdef HAVE_LONGLONG
 inline const cl_F operator+ (const long long x, const cl_F& y)
        { return cl_I(x) + y; }
 inline const cl_F operator+ (const unsigned long long x, const cl_F& y)
        { return cl_I(x) + y; }
-#endif
 inline const cl_F operator+ (const float x, const cl_F& y)
        { return cl_F(x) + y; }
 inline const cl_F operator+ (const double x, const cl_F& y)
@@ -191,12 +189,10 @@ inline const cl_F operator+ (const cl_F& x, const long y)
        { return x + cl_I(y); }
 inline const cl_F operator+ (const cl_F& x, const unsigned long y)
        { return x + cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_F operator+ (const cl_F& x, const long long y)
        { return x + cl_I(y); }
 inline const cl_F operator+ (const cl_F& x, const unsigned long long y)
        { return x + cl_I(y); }
-#endif
 inline const cl_F operator+ (const cl_F& x, const float y)
        { return x + cl_F(y); }
 inline const cl_F operator+ (const cl_F& x, const double y)
@@ -222,12 +218,10 @@ inline const cl_F operator- (const long x, const cl_F& y)
        { return cl_I(x) - y; }
 inline const cl_F operator- (const unsigned long x, const cl_F& y)
        { return cl_I(x) - y; }
-#ifdef HAVE_LONGLONG
 inline const cl_F operator- (const long long x, const cl_F& y)
        { return cl_I(x) - y; }
 inline const cl_F operator- (const unsigned long long x, const cl_F& y)
        { return cl_I(x) - y; }
-#endif
 inline const cl_F operator- (const float x, const cl_F& y)
        { return cl_F(x) - y; }
 inline const cl_F operator- (const double x, const cl_F& y)
@@ -240,12 +234,10 @@ inline const cl_F operator- (const cl_F& x, const long y)
        { return x - cl_I(y); }
 inline const cl_F operator- (const cl_F& x, const unsigned long y)
        { return x - cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_F operator- (const cl_F& x, const long long y)
        { return x - cl_I(y); }
 inline const cl_F operator- (const cl_F& x, const unsigned long long y)
        { return x - cl_I(y); }
-#endif
 inline const cl_F operator- (const cl_F& x, const float y)
        { return x - cl_F(y); }
 inline const cl_F operator- (const cl_F& x, const double y)
@@ -283,12 +275,10 @@ inline const cl_R operator* (const long x, const cl_F& y)
        { return cl_I(x) * y; }
 inline const cl_R operator* (const unsigned long x, const cl_F& y)
        { return cl_I(x) * y; }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator* (const long long x, const cl_F& y)
        { return cl_I(x) * y; }
 inline const cl_R operator* (const unsigned long long x, const cl_F& y)
        { return cl_I(x) * y; }
-#endif
 inline const cl_F operator* (const float x, const cl_F& y)
        { return cl_F(x) * y; }
 inline const cl_F operator* (const double x, const cl_F& y)
@@ -301,12 +291,10 @@ inline const cl_R operator* (const cl_F& x, const long y)
        { return x * cl_I(y); }
 inline const cl_R operator* (const cl_F& x, const unsigned long y)
        { return x * cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator* (const cl_F& x, const long long y)
        { return x * cl_I(y); }
 inline const cl_R operator* (const cl_F& x, const unsigned long long y)
        { return x * cl_I(y); }
-#endif
 inline const cl_F operator* (const cl_F& x, const float y)
        { return x * cl_F(y); }
 inline const cl_F operator* (const cl_F& x, const double y)
@@ -331,12 +319,10 @@ inline const cl_F operator/ (const cl_F& x, const long y)
        { return x / cl_I(y); }
 inline const cl_F operator/ (const cl_F& x, const unsigned long y)
        { return x / cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_F operator/ (const cl_F& x, const long long y)
        { return x / cl_I(y); }
 inline const cl_F operator/ (const cl_F& x, const unsigned long long y)
        { return x / cl_I(y); }
-#endif
 inline const cl_F operator/ (const cl_F& x, const float y)
        { return x / cl_F(y); }
 inline const cl_F operator/ (const cl_F& x, const double y)
@@ -349,12 +335,10 @@ inline const cl_R operator/ (const long x, const cl_F& y)
        { return cl_I(x) / y; }
 inline const cl_R operator/ (const unsigned long x, const cl_F& y)
        { return cl_I(x) / y; }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator/ (const long long x, const cl_F& y)
        { return cl_I(x) / y; }
 inline const cl_R operator/ (const unsigned long long x, const cl_F& y)
        { return cl_I(x) / y; }
-#endif
 inline const cl_F operator/ (const float x, const cl_F& y)
        { return cl_F(x) / y; }
 inline const cl_F operator/ (const double x, const cl_F& y)
@@ -556,29 +540,23 @@ extern const cl_F signum (const cl_F& x);
 
 // Returns the largest (most positive) floating point number in float format f.
 extern const cl_F most_positive_float (float_format_t f);
-//CL_REQUIRE(cl_F_mostpos)
 
 // Returns the smallest (most negative) floating point number in float format f.
 extern const cl_F most_negative_float (float_format_t f);
-//CL_REQUIRE(cl_F_mostneg)
 
 // Returns the least positive floating point number (i.e. > 0 but closest to 0)
 // in float format f.
 extern const cl_F least_positive_float (float_format_t f);
-//CL_REQUIRE(cl_F_leastpos)
 
 // Returns the least negative floating point number (i.e. < 0 but closest to 0)
 // in float format f.
 extern const cl_F least_negative_float (float_format_t f);
-//CL_REQUIRE(cl_F_leastneg)
 
 // Returns the smallest floating point number e > 0 such that 1+e != 1.
 extern const cl_F float_epsilon (float_format_t f);
-//CL_REQUIRE(cl_F_epspos)
 
 // Returns the smallest floating point number e > 0 such that 1-e != 1.
 extern const cl_F float_negative_epsilon (float_format_t f);
-//CL_REQUIRE(cl_F_epsneg)
 
 
 // Konversion zu einem C "float".
@@ -602,8 +580,6 @@ extern const cl_F pi (float_format_t f);
 // pi() liefert die Zahl pi im Default-Float-Format.
 extern const cl_F pi (void);
 
-//CL_REQUIRE(cl_F_pi_var)
-
 
 // sin(x) liefert den Sinus (sin x) eines Float x.
 extern const cl_F sin (const cl_F& x);
@@ -616,6 +592,7 @@ struct cos_sin_t {
        cl_R cos;
        cl_R sin;
 // Constructor:
+       cos_sin_t () {}
        cos_sin_t (const cl_R& u, const cl_R& v) : cos (u), sin (v) {}
 };
 
@@ -637,8 +614,6 @@ extern const cl_F exp1 (float_format_t f);
 // exp1() liefert die Zahl e = exp(1) im Default-Float-Format.
 extern const cl_F exp1 (void);
 
-//CL_REQUIRE(cl_F_exp1_var)
-
 
 // ln(x) liefert zu einem Float x>0 die Zahl ln(x).
 extern const cl_F ln (const cl_F& x);
@@ -659,6 +634,7 @@ struct cosh_sinh_t {
        cl_R cosh;
        cl_R sinh;
 // Constructor:
+       cosh_sinh_t () {}
        cosh_sinh_t (const cl_R& u, const cl_R& v) : cosh (u), sinh (v) {}
 };
 
@@ -681,9 +657,6 @@ extern const cl_F eulerconst (float_format_t f);
 // eulerconst() liefert die Eulersche Konstante im Default-Float-Format.
 extern const cl_F eulerconst (void);
 
-//CL_REQUIRE(cl_F_eulerconst_var)
-
-
 // catalanconst(y) liefert die Catalansche Konstante
 // im selben Float-Format wie y.
 // > y: ein Float
@@ -696,9 +669,6 @@ extern const cl_F catalanconst (float_format_t f);
 // catalanconst() liefert die Catalansche Konstante im Default-Float-Format.
 extern const cl_F catalanconst (void);
 
-//CL_REQUIRE(cl_F_catalanconst_var)
-
-
 // zeta(s) returns the Riemann zeta function at s>1.
 extern const cl_F zeta (int s, const cl_F& y);
 extern const cl_F zeta (int s, float_format_t f);
@@ -714,7 +684,6 @@ inline const cl_F random_F (const cl_F& n)
        { return random_F(default_random_state,n); }
 
 
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_F& operator+= (cl_F& x, const cl_F& y) { return x = x + y; }
 inline cl_F& operator+= (cl_F& x, const float y) { return x = x + y; }
@@ -732,7 +701,6 @@ inline cl_F& operator*= (cl_F& x, const double y) { return x = x * y; }
 inline cl_F& operator/= (cl_F& x, const cl_F& y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const float y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const double y) { return x = x / y; }
-#endif
 
 // Thrown when a floating-point exception occurs.
 class floating_point_exception : public runtime_exception {
@@ -760,7 +728,6 @@ public:
 };
 
 
-CL_REQUIRE(cl_ieee)
 
 
 // If this is true, floating point underflow returns zero instead of throwing an exception.