Hi Everyone,

We are using xalan 2.7.0 in our product. I recently faced an issue which I found exists in Java Double.
In nodeset summation using double the output is not precise

Ref: http://stackoverflow.com/questions/5257166/java-floats-and-doubles-how-to-avoid-that-0-0-0-1-0-1-0-9000001

In class org.apache.xpath.functions.FuncSum#execute, double is being used. It all works perfectly fine but when I debugged the source I found the problem occurs after summation is done in the line after returning from toDouble() in

sum += s.toDouble();

when I did a test on a seperate Java sample I faced a similar result. It appears that using BigInteger could help resolve the problem.

Thanks & Regards,
Bhuvan Rawal

Reply via email to