dbertoni    01/06/25 14:19:25

  Modified:    c/src/XSLT NodeSorter.cpp
  Log:
  Fix sort order for NaN as described in erratum 15.
  
  Revision  Changes    Path
  1.22      +13 -7     xml-xalan/c/src/XSLT/NodeSorter.cpp
  
  Index: NodeSorter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NodeSorter.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- NodeSorter.cpp    2001/05/10 17:59:11     1.21
  +++ NodeSorter.cpp    2001/06/25 21:19:17     1.22
  @@ -211,13 +211,19 @@
                double  n1Num = getNumberResult(theKey, theKeyIndex, theLHS);
                double  n2Num = getNumberResult(theKey, theKeyIndex, theRHS);
   
  -             if (DoubleSupport::isNaN(n1Num))
  -                     n1Num = 0.0;
  -
  -             if (DoubleSupport::isNaN(n2Num))
  -                     n2Num = 0.0;
  -
  -             if (DoubleSupport::lessThan(n1Num, n2Num) == true)
  +             // Always order NaN before anything else...
  +             if (DoubleSupport::isNaN(n1Num) == true)
  +             {
  +                     if (DoubleSupport::isNaN(n2Num) == false)
  +                     {
  +                             theResult = -1;
  +                     }
  +             }
  +             else if (DoubleSupport::isNaN(n2Num) == true)
  +             {
  +                     theResult = 1;
  +             }
  +             else if (DoubleSupport::lessThan(n1Num, n2Num) == true)
                {
                        theResult = -1;
                }
  
  
  

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

Reply via email to