diff --git a/src/util/XMLDouble.cpp b/src/util/XMLDouble.cpp index 5e48ac17d1cb3f3c1de895f893f75704c4e10219..4102d226696f97e7d0f83200074fc150c8d1fffd 100644 --- a/src/util/XMLDouble.cpp +++ b/src/util/XMLDouble.cpp @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.6 2001/07/31 13:48:29 peiyongz + * fValue removed + * * Revision 1.5 2001/07/27 20:43:53 peiyongz * copy ctor: to check for special types. * @@ -188,7 +191,6 @@ XMLDouble::XMLDouble(const XMLCh* const strValue) :fMantissa(0) ,fExponent(0) ,fType(Normal) -,fValue(0) { try { @@ -276,8 +278,6 @@ void XMLDouble::init(const XMLCh* const strValue) fExponent = new XMLBigInteger(XMLUni::fgZeroString); } - fValue = fMantissa->doubleValue() * pow(10.0, fExponent->intValue()); - checkBoundary(tmpStrValue); } @@ -325,7 +325,6 @@ XMLDouble::XMLDouble(const XMLDouble& toCopy) :fMantissa(0) ,fExponent(0) ,fType(Normal) -,fValue(0) { if (!toCopy.isSpecialValue()) { @@ -334,7 +333,6 @@ XMLDouble::XMLDouble(const XMLDouble& toCopy) } fType = toCopy.fType; - fValue = toCopy.fValue; } // @@ -461,7 +459,7 @@ int XMLDouble::compareSpecial(const XMLDouble* const specialValue case NegZero: case PosZero: - return (normalValue->doubleValue() > 0 ? -1 : 1); + return (normalValue->getSign() > 0 ? -1 : 1); case PosINF: return 1; diff --git a/src/util/XMLDouble.hpp b/src/util/XMLDouble.hpp index b731d8df189330bb3987960fe6cefd8314eb973f..0db05f78b789eb736bfba547940e0d741bfd5283 100644 --- a/src/util/XMLDouble.hpp +++ b/src/util/XMLDouble.hpp @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.4 2001/07/31 13:48:29 peiyongz + * fValue removed + * * Revision 1.3 2001/07/26 18:21:15 peiyongz * Boundary Checking * @@ -120,7 +123,7 @@ public: XMLDouble(const XMLDouble& toCopy); - double doubleValue() const; + int getSign() const; /** * Return string representation of the decimal value. @@ -172,15 +175,11 @@ private: // fType // the type of the object. // - // fValue - // the built-in double value of the object. - // // ----------------------------------------------------------------------- XMLBigDecimal* fMantissa; XMLBigInteger* fExponent; LiteralType fType; - double fValue; }; inline XMLDouble::~XMLDouble() @@ -188,9 +187,9 @@ inline XMLDouble::~XMLDouble() cleanUp(); } -inline double XMLDouble::doubleValue() const +inline int XMLDouble::getSign() const { - return fValue; + return fMantissa->getSign(); } inline bool XMLDouble::operator==(const XMLDouble& toCompare) const diff --git a/src/util/XMLFloat.cpp b/src/util/XMLFloat.cpp index d6369eaff1e4ac29db25e790052ce1810e17cae3..9558a3e825a5b5e193ad28cfc1afbefdf1cbcc2b 100644 --- a/src/util/XMLFloat.cpp +++ b/src/util/XMLFloat.cpp @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.3 2001/07/31 13:48:29 peiyongz + * fValue removed + * * Revision 1.2 2001/07/27 20:43:53 peiyongz * copy ctor: to check for special types. * @@ -176,7 +179,6 @@ XMLFloat::XMLFloat(const XMLCh* const strValue) :fMantissa(0) ,fExponent(0) ,fType(Normal) -,fValue(0) { try { @@ -264,8 +266,6 @@ void XMLFloat::init(const XMLCh* const strValue) fExponent = new XMLBigInteger(XMLUni::fgZeroString); } - fValue = (float) fMantissa->doubleValue() * (float) (pow(10.0, fExponent->intValue())); - checkBoundary(tmpStrValue); } @@ -313,7 +313,6 @@ XMLFloat::XMLFloat(const XMLFloat& toCopy) :fMantissa(0) ,fExponent(0) ,fType(Normal) -,fValue(0) { if (!toCopy.isSpecialValue()) { @@ -322,7 +321,6 @@ XMLFloat::XMLFloat(const XMLFloat& toCopy) } fType = toCopy.fType; - fValue = toCopy.fValue; } // @@ -449,7 +447,7 @@ int XMLFloat::compareSpecial(const XMLFloat* const specialValue case NegZero: case PosZero: - return (normalValue->floatValue() > 0 ? -1 : 1); + return (normalValue->getSign() > 0 ? -1 : 1); case PosINF: return 1; diff --git a/src/util/XMLFloat.hpp b/src/util/XMLFloat.hpp index eff7a98c8b9307489c401adc499940386ce53d14..c12dda233150f2658c9ffb94a461f36c02b223f8 100644 --- a/src/util/XMLFloat.hpp +++ b/src/util/XMLFloat.hpp @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.2 2001/07/31 13:48:29 peiyongz + * fValue removed + * * Revision 1.1 2001/07/26 20:41:37 peiyongz * XMLFloat * @@ -115,9 +118,9 @@ public: XMLFloat(const XMLFloat& toCopy); - float floatValue() const; + int getSign() const; - /** + /** * Return string representation of the decimal value. * A decimal point will be included as necessary, * the caller of this method is responsible for the @@ -167,15 +170,11 @@ private: // fType // the type of the object. // - // fValue - // the built-in float value of the object. - // // ----------------------------------------------------------------------- XMLBigDecimal* fMantissa; XMLBigInteger* fExponent; LiteralType fType; - float fValue; }; inline XMLFloat::~XMLFloat() @@ -183,11 +182,6 @@ inline XMLFloat::~XMLFloat() cleanUp(); } -inline float XMLFloat::floatValue() const -{ - return fValue; -} - inline bool XMLFloat::operator==(const XMLFloat& toCompare) const { return ( XMLFloat::compareValues(this, &toCompare) == 0 ? true : false); @@ -207,4 +201,8 @@ inline void XMLFloat::cleanUp() delete fExponent; } +inline int XMLFloat::getSign() const +{ + return fMantissa->getSign(); +} #endif