/[GiNaC]/ginac/numeric.h
ViewVC logotype

Diff of /ginac/numeric.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.47 by kreckel, Sat Feb 17 18:07:08 2001 UTC revision 1.48 by kreckel, Wed Feb 28 12:54:53 2001 UTC
# Line 38  namespace cln { class cl_N; } Line 38  namespace cln { class cl_N; }
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
# Line 63  public: Line 61  public:
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
# Line 75  class numeric : public basic Line 73  class numeric : public basic
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);
# Line 101  public: Line 99  public:
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    
# Line 173  protected: Line 173  protected:
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    
# Line 300  inline const numeric &ex_to_numeric(cons Line 297  inline const numeric &ex_to_numeric(cons
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;

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48

Christian Bauer">Christian Bauer
ViewVC Help
Powered by ViewVC 1.1.15