*
* Makes the interface to the underlying bignum package available. */
-#ifndef _NUMERIC_H_
-#define _NUMERIC_H_
+/*
+ * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
-#include <strstream>
+#ifndef __GINAC_NUMERIC_H__
+#define __GINAC_NUMERIC_H__
-#define HASHVALUE_NUMERIC 0x80000001U
+#include <strstream>
+#include <ginac/basic.h>
+#include <ginac/ex.h>
-class numeric; // Forward declaration, so basic doesn't argue...
class cl_N; // We want to include cln.h only in numeric.cpp in order to
// avoid namespace pollution and keep compile-time low.
-#include "basic.h"
+
+namespace GiNaC {
+
+#define HASHVALUE_NUMERIC 0x80000001U
/** This class is used to instantiate a global object Digits which
* behaves just like Maple's Digits. We need an object rather than a
numeric power_dyn(numeric const & other) const { return power(other); }
*/
numeric inverse(void) const;
+ int csgn(void) const;
int compare(numeric const & other) const;
bool is_equal(numeric const & other) const;
bool is_zero(void) const;
inline numeric inverse(numeric const & x)
{ return x.inverse(); }
+inline bool csgn(numeric const & x)
+{ return x.csgn(); }
+
inline bool is_zero(numeric const & x)
{ return x.is_zero(); }
ex EulerGammaEvalf(void);
ex CatalanEvalf(void);
-#define ex_to_numeric(X) static_cast<numeric const &>(*(X).bp)
+// utility functions
+inline const numeric &ex_to_numeric(const ex &e)
+{
+ return static_cast<const numeric &>(*e.bp);
+}
+} // namespace GiNaC
-#endif // ndef _NUMERIC_H_
+#endif // ndef __GINAC_NUMERIC_H__