[xml] XPath mod operator problems

Hi Daniel, all,

Part of this has allready been posted to the xslt list, but since the
real problem seems to be within libxml2, I'll continue here.

I can't reach the bugzilla site at the moment, so maybe this
phenomenon has allready been posted.

I've used libxml2-2.4.22 on all systems mentioned. 

Here we go.  On i386 platform I get the correct results:

    ./testXPath --expr '8 mod 3 = 2'
    Object is a Boolean : true

But on HP-UX 10.20 and linux-alpha:

    ./testXPath --expr '8 mod 3'
    Object is a number : 2

    ./testXPath --expr '8 mod 3 = 2'
    Object is a Boolean : false

Can anybody reproduce this on other platforms?
Daniel, should this test be added to the regression tests?

When I change the following lines of xpath.c (l. 4890, 4891),

        ctxt->value->floatval = arg2 * (tmp - (double)((int)tmp));


        ctxt->value->floatval = fmod(arg1, arg2);

the behaviour looks correct.  But I don't know if fmod conforms
to the XPath requirements of the `mod' operator.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]