X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fnumeric.h;h=a460d09989bf5db363c923da2bf6c85ff9718923;hp=01e2ad60677aeef26b725a9fd0aaa787d17fc186;hb=9eab44408b9213d8909b7a9e525f404ad06064dd;hpb=487e5659efe401683eee0381b0d23f967ffffc3c;ds=sidebyside diff --git a/ginac/numeric.h b/ginac/numeric.h index 01e2ad60..a460d099 100644 --- a/ginac/numeric.h +++ b/ginac/numeric.h @@ -25,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 @@ -318,7 +321,12 @@ ex PiEvalf(void); 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__