| 38 |
#include <cln/complex_class.h> |
#include <cln/complex_class.h> |
| 39 |
#endif |
#endif |
| 40 |
|
|
|
#ifndef NO_NAMESPACE_GINAC |
|
| 41 |
namespace GiNaC { |
namespace GiNaC { |
|
#endif // ndef NO_NAMESPACE_GINAC |
|
| 42 |
|
|
| 43 |
#define HASHVALUE_NUMERIC 0x80000001U |
#define HASHVALUE_NUMERIC 0x80000001U |
| 44 |
|
|
| 45 |
/** This class is used to instantiate a global object Digits which |
/** This class is used to instantiate a global singleton object Digits |
| 46 |
* behaves just like Maple's Digits. We need an object rather than a |
* which behaves just like Maple's Digits. We need an object rather |
| 47 |
* dumber basic type since as a side-effect we let it change |
* than a dumber basic type since as a side-effect we let it change |
| 48 |
* cl_default_float_format when it gets changed. The only other |
* cl_default_float_format when it gets changed. The only other |
| 49 |
* meaningful thing to do with it is converting it to an unsigned, |
* meaningful thing to do with it is converting it to an unsigned, |
| 50 |
* for temprary storing its value e.g. The user must not create an |
* for temprary storing its value e.g. The user must not create an |
| 61 |
void print(std::ostream & os) const; |
void print(std::ostream & os) const; |
| 62 |
// member variables |
// member variables |
| 63 |
private: |
private: |
| 64 |
long digits; |
long digits; ///< Number of decimal digits |
| 65 |
static bool too_late; |
static bool too_late; ///< Already one object present |
| 66 |
}; |
}; |
| 67 |
|
|
| 68 |
/** This class is a wrapper around CLN-numbers within the GiNaC class |
/** This class is a wrapper around CLN-numbers within the GiNaC class |
| 73 |
|
|
| 74 |
// member functions |
// member functions |
| 75 |
|
|
| 76 |
// other constructors |
// other ctors |
| 77 |
public: |
public: |
| 78 |
explicit numeric(int i); |
explicit numeric(int i); |
| 79 |
explicit numeric(unsigned int i); |
explicit numeric(unsigned int i); |
| 99 |
ex smod(const numeric &xi) const; |
ex smod(const numeric &xi) const; |
| 100 |
numeric max_coefficient(void) const; |
numeric max_coefficient(void) const; |
| 101 |
protected: |
protected: |
| 102 |
ex derivative(const symbol & s) const; |
/** Implementation of ex::diff for a numeric always returns 0. |
| 103 |
|
* @see ex::diff */ |
| 104 |
|
ex derivative(const symbol &s) const { return _ex0(); } |
| 105 |
bool is_equal_same_type(const basic & other) const; |
bool is_equal_same_type(const basic & other) const; |
| 106 |
unsigned calchash(void) const; |
unsigned calchash(void) const; |
| 107 |
|
|
| 173 |
extern const numeric I; |
extern const numeric I; |
| 174 |
extern _numeric_digits Digits; |
extern _numeric_digits Digits; |
| 175 |
|
|
| 176 |
//#define is_a_numeric_hash(x) ((x)==HASHVALUE_NUMERIC) |
// deprecated macro, for internal use only |
| 177 |
// may have to be changed to ((x)>=0x80000000U) |
#define is_a_numeric_hash(x) ((x)&0x80000000U) |
|
|
|
|
// has been changed |
|
|
//#define is_a_numeric_hash(x) ((x)&0x80000000U) |
|
| 178 |
|
|
| 179 |
// global functions |
// global functions |
| 180 |
|
|
| 297 |
return static_cast<const numeric &>(*e.bp); |
return static_cast<const numeric &>(*e.bp); |
| 298 |
} |
} |
| 299 |
|
|
|
|
|
|
#ifndef NO_NAMESPACE_GINAC |
|
| 300 |
} // namespace GiNaC |
} // namespace GiNaC |
|
#endif // ndef NO_NAMESPACE_GINAC |
|
| 301 |
|
|
| 302 |
#ifdef __MAKECINT__ |
#ifdef __MAKECINT__ |
| 303 |
#pragma link off defined_in cln/number.h; |
#pragma link off defined_in cln/number.h; |