]> www.ginac.de Git - ginac.git/blobdiff - ginac/numeric.h
- prepared for 1.0.13 release
[ginac.git] / ginac / numeric.h
index d727fe35908bc3c4666c2fa1ffd2118c8f56b8f0..c56c56bd84dee5ae85715c7ca70ee0879d218ee3 100644 (file)
@@ -3,7 +3,7 @@
  *  Makes the interface to the underlying bignum package available. */
 
 /*
- *  GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -72,19 +72,22 @@ class numeric : public basic
        
        // other ctors
 public:
-       explicit numeric(int i);
-       explicit numeric(unsigned int i);
-       explicit numeric(long i);
-       explicit numeric(unsigned long i);
-       explicit numeric(long numer, long denom);
-       explicit numeric(double d);
-       explicit numeric(const char *);
+       numeric(int i);
+       numeric(unsigned int i);
+       numeric(long i);
+       numeric(unsigned long i);
+       numeric(long numer, long denom);
+       numeric(double d);
+       numeric(const char *);
        
-       // functions overriding virtual functions from bases classes
+       // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
        unsigned precedence(void) const {return 30;}
        bool info(unsigned inf) const;
+       int degree(const ex & s) const;
+       int ldegree(const ex & s) const;
+       ex coeff(const ex & s, int n = 1) const;
        bool has(const ex &other) const;
        ex eval(int level = 0) const;
        ex evalf(int level = 0) const;
@@ -96,7 +99,7 @@ public:
 protected:
        /** Implementation of ex::diff for a numeric always returns 0.
         *  @see ex::diff */
-       ex derivative(const symbol &s) const { return _ex0(); }
+       ex derivative(const symbol &s) const { return 0; }
        bool is_equal_same_type(const basic &other) const;
        unsigned calchash(void) const;
        
@@ -286,13 +289,6 @@ ex CatalanEvalf(void);
 
 // utility functions
 
-/** Return the numeric object handled by an ex.
- *  This is unsafe: you need to check the type first. */
-inline const numeric &ex_to_numeric(const ex &e)
-{
-       return static_cast<const numeric &>(*e.bp);
-}
-
 /** Specialization of is_exactly_a<numeric>(obj) for numeric objects. */
 template<> inline bool is_exactly_a<numeric>(const basic & obj)
 {