[GiNaC-devel] Expression comparison

Peter Grobarcik coder.peter.grobarcik at googlemail.com
Mon Sep 29 12:48:21 CEST 2008


Hallo,

I am a GiNaC newbe and I seem not to understand expression comparisons fully,

I have following test case which does not work as I expected:

    void testNumComparison() {
    	Num v0 = sqrt(Num(2));
    	Num v1 = sqrt(Num(10));
    	stringstream strm;
    	strm << "v0("<<v0<<") < v1("<<v1<<") ?";
    	CPPUNIT_ASSERT_MESSAGE(strm.str(),v0<v1);
   }

Where Num is GiNaC::ex.

Doing v0.evalf() < v1.evalf() works.

Can somebody give me (or point me to) some info about expression comparison?

Cheers and thx in advance,

Peter


More information about the GiNaC-devel mailing list