System.Xml.Xsl.Runtime.XmlDoubleSortKey.XmlDoubleSortKey C# (CSharp) Method

XmlDoubleSortKey() public method

public XmlDoubleSortKey ( double value, XmlCollation collation ) : System
value double
collation XmlCollation
return System
        public XmlDoubleSortKey(double value, XmlCollation collation)
        {
            if (Double.IsNaN(value))
            {
                // Treat NaN as if it were the empty sequence
                _isNaN = true;

                // Greatest, Ascending: isEmptyGreatest = true
                // Greatest, Descending: isEmptyGreatest = false
                // Least, Ascending: isEmptyGreatest = false
                // Least, Descending: isEmptyGreatest = true
                _dblVal = (collation.EmptyGreatest != collation.DescendingOrder) ? Double.PositiveInfinity : Double.NegativeInfinity;
            }
            else
            {
                _dblVal = collation.DescendingOrder ? -value : value;
            }
        }