dbertoni    02/03/27 23:09:49

  Modified:    c/src/PlatformSupport DoubleSupport.cpp
  Log:
  Make sure we do floating-point modulus when necessary.
  
  Revision  Changes    Path
  1.30      +13 -1     xml-xalan/c/src/PlatformSupport/DoubleSupport.cpp
  
  Index: DoubleSupport.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DoubleSupport.cpp,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- DoubleSupport.cpp 26 Sep 2001 21:44:05 -0000      1.29
  +++ DoubleSupport.cpp 28 Mar 2002 07:09:49 -0000      1.30
  @@ -340,9 +340,21 @@
        {
                return theRHS;
        }
  -     else
  +     else if (theRHS == 0.0)
  +     {
  +             return getNaN();
  +     }
  +     else if (long(theLHS) == theLHS && long(theRHS) == theRHS)
        {
                return long(theLHS) % long(theRHS);
  +     }
  +     else
  +     {
  +             double  theDummy;
  +
  +             double  theResult = divide(theLHS, theRHS);
  +
  +             return modf(theResult, &theDummy) * theRHS;
        }
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to