]> www.ginac.de Git - ginac.git/blobdiff - ginac/numeric.h
- changed behaviour of numeric::is_rational() and added numeric::is_cinteger()
[ginac.git] / ginac / numeric.h
index 92755b3eb390978e263646552a15fec02a0a54de..168651d4a665b5e07662c91575565df177b3d69e 100644 (file)
@@ -30,7 +30,9 @@
 class cl_N;     // We want to include cln.h only in numeric.cpp in order to 
                 // avoid namespace pollution and keep compile-time low.
 
+#ifndef NO_GINAC_NAMESPACE
 namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
 
 #define HASHVALUE_NUMERIC 0x80000001U
 
@@ -77,6 +79,7 @@ class numeric : public basic
     friend numeric asinh(numeric const & x);
     friend numeric acosh(numeric const & x);
     friend numeric atanh(numeric const & x);
+    friend numeric bernoulli(numeric const & n);
     friend numeric abs(numeric const & x);
     friend numeric mod(numeric const & a, numeric const & b);
     friend numeric smod(numeric const & a, numeric const & b);
@@ -184,6 +187,8 @@ public:
     bool is_prime(void) const;
     bool is_rational(void) const;
     bool is_real(void) const;
+    bool is_cinteger(void) const;
+    bool is_crational(void) const;
     bool operator==(numeric const & other) const;
     bool operator!=(numeric const & other) const;
     bool operator<(numeric const & other) const;
@@ -240,10 +245,12 @@ numeric acosh(numeric const & x);
 numeric atanh(numeric const & x);
 numeric zeta(numeric const & x);
 numeric gamma(numeric const & x);
+numeric psi(numeric const & x);
 numeric psi(numeric const & n, numeric const & x);
 numeric factorial(numeric const & n);
 numeric doublefactorial(numeric const & n);
 numeric binomial(numeric const & n, numeric const & k);
+numeric bernoulli(numeric const & n);
 
 numeric abs(numeric const & x);
 numeric mod(numeric const & a, numeric const & b);
@@ -314,15 +321,8 @@ inline numeric numer(numeric const & x)
 inline numeric denom(numeric const & x)
 { return x.denom(); }
 
-/* do we need this any more? */
-//inline numeric factorial(int n)
-//{ return factorial(numeric(n)); }
+// numeric evaluation functions for class constant objects:
 
-/* do we need this any more? */
-//inline numeric binomial(int n, int k)
-//{ return binomial(numeric(n), numeric(k)); }
-
-ex IEvalf(void);
 ex PiEvalf(void);
 ex EulerGammaEvalf(void);
 ex CatalanEvalf(void);
@@ -333,6 +333,8 @@ inline const numeric &ex_to_numeric(const ex &e)
        return static_cast<const numeric &>(*e.bp);
 }
 
+#ifndef NO_GINAC_NAMESPACE
 } // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
 
 #endif // ndef __GINAC_NUMERIC_H__