[GiNaC-list] Relations using possymbol

Richard B. Kreckel kreckel at ginac.de
Wed Mar 23 10:28:07 CET 2011


Hi!

On 03/22/2011 09:32 PM, Michael Boyer wrote:
> I am confused by the behavior of possymbols in relations. Consider the
> following program:
>
> ------------------------------------------------
> #include<ginac/ginac.h>
> using namespace GiNaC;
>
> int main() {
>         possymbol x("x");
>
>         if (x.info(info_flags::positive)) std::cout<<  "x is positive\n";
>         else                              std::cout<<  "x is _not_ positive\n";
>
>         if (x>  0) std::cout<<  "x is greater than zero\n";
>         else       std::cout<<  "x is _not_ greater than zero\n";
> }
> ------------------------------------------------
>
> I would expect the output to be:
> x is positive
> x is greater than zero
>
> But the output I get is:
> x is positive
> x is _not_ greater than zero
>
>
> Am I misunderstanding the use of possymbol?

Please check the tutorial, in particular the section "Ordering 
expressions". I hope this answers your question.

   -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>


More information about the GiNaC-list mailing list