--- ginac/numeric.h 1999/11/10 19:35:49 1.3 +++ ginac/numeric.h 1999/11/19 15:46:20 1.7 @@ -1,7 +1,8 @@ /** @file numeric.h * - * Makes the interface to the underlying bignum package available. - * + * Makes the interface to the underlying bignum package available. */ + +/* * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify @@ -24,12 +25,15 @@ #include #include - -#define HASHVALUE_NUMERIC 0x80000001U +#include class cl_N; // We want to include cln.h only in numeric.cpp in order to // avoid namespace pollution and keep compile-time low. +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 * dumber basic type since as a side-effect we let it change @@ -166,6 +170,7 @@ 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; @@ -233,7 +238,9 @@ numeric asinh(numeric const & x); numeric acosh(numeric const & x); numeric atanh(numeric const & x); +numeric zeta(numeric const & x); numeric gamma(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); @@ -262,6 +269,9 @@ 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(); } @@ -317,7 +327,12 @@ ex EulerGammaEvalf(void); ex CatalanEvalf(void); -#define ex_to_numeric(X) static_cast(*(X).bp) +// utility functions +inline const numeric &ex_to_numeric(const ex &e) +{ + return static_cast(*e.bp); +} +} // namespace GiNaC #endif // ndef __GINAC_NUMERIC_H__