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

Diff of /ginac/numeric.h

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

revision 1.3 by cbauer, Wed Nov 10 19:35:49 1999 UTC revision 1.8 by kreckel, Mon Nov 22 15:26:18 1999 UTC
# Line 1  Line 1 
1  /** @file numeric.h  /** @file numeric.h
2   *   *
3   *  Makes the interface to the underlying bignum package available.   *  Makes the interface to the underlying bignum package available. */
4   *  
5    /*
6   *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany   *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
7   *   *
8   *  This program is free software; you can redistribute it and/or modify   *  This program is free software; you can redistribute it and/or modify
# Line 24  Line 25 
25    
26  #include <strstream>  #include <strstream>
27  #include <ginac/basic.h>  #include <ginac/basic.h>
28    #include <ginac/ex.h>
 #define HASHVALUE_NUMERIC 0x80000001U  
29    
30  class cl_N;     // We want to include cln.h only in numeric.cpp in order to  class cl_N;     // We want to include cln.h only in numeric.cpp in order to
31                  // avoid namespace pollution and keep compile-time low.                  // avoid namespace pollution and keep compile-time low.
32    
33    namespace GiNaC {
34    
35    #define HASHVALUE_NUMERIC 0x80000001U
36    
37  /** This class is used to instantiate a global object Digits which  /** This class is used to instantiate a global object Digits which
38   *  behaves just like Maple's Digits.  We need an object rather than a   *  behaves just like Maple's Digits.  We need an object rather than a
39   *  dumber basic type since as a side-effect we let it change   *  dumber basic type since as a side-effect we let it change
# Line 73  class numeric : public basic Line 77  class numeric : public basic
77      friend numeric asinh(numeric const & x);      friend numeric asinh(numeric const & x);
78      friend numeric acosh(numeric const & x);      friend numeric acosh(numeric const & x);
79      friend numeric atanh(numeric const & x);      friend numeric atanh(numeric const & x);
80        friend numeric bernoulli(numeric const & n);
81      friend numeric abs(numeric const & x);      friend numeric abs(numeric const & x);
82      friend numeric mod(numeric const & a, numeric const & b);      friend numeric mod(numeric const & a, numeric const & b);
83      friend numeric smod(numeric const & a, numeric const & b);      friend numeric smod(numeric const & a, numeric const & b);
# Line 166  public: Line 171  public:
171      numeric power_dyn(numeric const & other) const { return power(other); }      numeric power_dyn(numeric const & other) const { return power(other); }
172      */      */
173      numeric inverse(void) const;      numeric inverse(void) const;
174        int csgn(void) const;
175      int compare(numeric const & other) const;      int compare(numeric const & other) const;
176      bool is_equal(numeric const & other) const;      bool is_equal(numeric const & other) const;
177      bool is_zero(void) const;      bool is_zero(void) const;
# Line 233  numeric tanh(numeric const & x); Line 239  numeric tanh(numeric const & x);
239  numeric asinh(numeric const & x);  numeric asinh(numeric const & x);
240  numeric acosh(numeric const & x);  numeric acosh(numeric const & x);
241  numeric atanh(numeric const & x);  numeric atanh(numeric const & x);
242    numeric zeta(numeric const & x);
243  numeric gamma(numeric const & x);  numeric gamma(numeric const & x);
244    numeric psi(numeric const & n, numeric const & x);
245  numeric factorial(numeric const & n);  numeric factorial(numeric const & n);
246  numeric doublefactorial(numeric const & n);  numeric doublefactorial(numeric const & n);
247  numeric binomial(numeric const & n, numeric const & k);  numeric binomial(numeric const & n, numeric const & k);
248    numeric bernoulli(numeric const & n);
249    
250  numeric abs(numeric const & x);  numeric abs(numeric const & x);
251  numeric mod(numeric const & a, numeric const & b);  numeric mod(numeric const & a, numeric const & b);
# Line 262  struct numeric_fail Line 271  struct numeric_fail
271  inline numeric inverse(numeric const & x)  inline numeric inverse(numeric const & x)
272  { return x.inverse(); }  { return x.inverse(); }
273    
274    inline bool csgn(numeric const & x)
275    { return x.csgn(); }
276    
277  inline bool is_zero(numeric const & x)  inline bool is_zero(numeric const & x)
278  { return x.is_zero(); }  { return x.is_zero(); }
279    
# Line 317  ex PiEvalf(void); Line 329  ex PiEvalf(void);
329  ex EulerGammaEvalf(void);  ex EulerGammaEvalf(void);
330  ex CatalanEvalf(void);  ex CatalanEvalf(void);
331    
332  #define ex_to_numeric(X) static_cast<numeric const &>(*(X).bp)  // utility functions
333    inline const numeric &ex_to_numeric(const ex &e)
334    {
335            return static_cast<const numeric &>(*e.bp);
336    }
337    
338    } // namespace GiNaC
339    
340  #endif // ndef __GINAC_NUMERIC_H__  #endif // ndef __GINAC_NUMERIC_H__

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.8

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