]> www.ginac.de Git - ginac.git/commitdiff
Make step(0)=1 for greater consistency.
authorChris Dams <Chris.Dams@mi.infn.it>
Thu, 9 Mar 2006 20:02:05 +0000 (20:02 +0000)
committerChris Dams <Chris.Dams@mi.infn.it>
Thu, 9 Mar 2006 20:02:05 +0000 (20:02 +0000)
ginac/numeric.cpp
ginac/numeric.h

index b8170e716ff3220685cb490d1a9ccf6473c23947..18943d3fdfb1f37f5b32506b4a96a27f82328a0a 100644 (file)
@@ -931,10 +931,10 @@ const numeric numeric::inverse() const
  *  ignored because the step function is generally considered real but
  *  a numeric may develop a small imaginary part due to rounding errors.
  */
-numeric numeric::step() const
+int numeric::step() const
 {      cln::cl_R r = cln::realpart(value);
        if(cln::zerop(r))
-               return numeric(1,2);
+               return 1;
        if(cln::plusp(r))
                return 1;
        return 0;
index f0e3362f8965aec7bcd5aaf199e6d65f1f3362d7..2cf93480cf9eb16fb812cc4403882f526c20f33b 100644 (file)
@@ -148,7 +148,7 @@ public:
        const numeric & operator=(double d);
        const numeric & operator=(const char *s);
        const numeric inverse() const;
-       numeric step() const;
+       int step() const;
        int csgn() const;
        int compare(const numeric &other) const;
        bool is_equal(const numeric &other) const;
@@ -251,7 +251,7 @@ inline const numeric pow(const numeric &x, const numeric &y)
 inline const numeric inverse(const numeric &x)
 { return x.inverse(); }
 
-inline numeric step(const numeric &x)
+inline int step(const numeric &x)
 { return x.step(); }
 
 inline int csgn(const numeric &x)