Possbility for positive symbols/numbers.
[ginac.git] / ginac / symbol.cpp
index 59dda652a133f3e71b0c0930696beb41139947d1..7e3b49d8bc7c0e59bcecf4c4034cfaaed1050a47 100644 (file)
@@ -196,7 +196,9 @@ bool symbol::info(unsigned inf) const
            inf == info_flags::rational_function)
                return true;
        if (inf == info_flags::real)
            inf == info_flags::rational_function)
                return true;
        if (inf == info_flags::real)
-               return domain == domain::real;
+               return domain==domain::real || domain==domain::positive;
+       if (inf == info_flags::nonnegative)
+               return domain == domain::positive;
        else
                return inherited::info(inf);
 }
        else
                return inherited::info(inf);
 }
@@ -228,14 +230,14 @@ ex symbol::conjugate() const
 
 ex symbol::real_part() const
 {
 
 ex symbol::real_part() const
 {
-       if (domain == domain::real)
+       if (domain==domain::real || domain==domain::positive)
                return *this;
        return real_part_function(*this).hold();
 }
 
 ex symbol::imag_part() const
 {
                return *this;
        return real_part_function(*this).hold();
 }
 
 ex symbol::imag_part() const
 {
-       if (domain == domain::real)
+       if (domain==domain::real || domain==domain::positive)
                return 0;
        return imag_part_function(*this).hold();
 }
                return 0;
        return imag_part_function(*this).hold();
 }