[xml] Test comparison fails on value (-2147483648)
- From: Chris_Poblete Dell com
- To: xml gnome org
- Subject: [xml] Test comparison fails on value (-2147483648)
- Date: Sun, 26 Aug 2001 12:37:55 -0500
VERSIONS: libxml2-2.4.3
libxslt-1.0.3
PROBLEM:
The tag <xsl:when test="OutputWatts < 0"> fails to evaluate correctly
when OutputWatts is equal to -2147483648.
PROPOSED RESOLUTION:
xpath:xmlXPathStringEvalNumber(6567)
------------------------------------------------------------
< ret = (double) tmp;
----------
ret = (double) tmp;
// Variable tmp is declared as signed integer which may evaluate to
a negative
// number. We only need to calculate the absolute value of the
whole number since
// any negative character in the input string has been flagged
separately.
if (tmp < 0)
ret = -ret;
------------------------------------------------------------
_______________________________
Chris Poblete
Dell © Enterprise Servers Group
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]