Fan.Sys.Double.CompareTo C# (CSharp) Méthode

CompareTo() public méthode

public CompareTo ( object obj ) : int
obj object
Résultat int
        public int CompareTo(object obj)
        {
            double that = ((Double)obj).val;
              if (Double.isNaN(val))
              {
            if (Double.isNaN(that)) return 0;
            if (System.Double.IsPositiveInfinity(that)) return 1;
            if (System.Double.IsNegativeInfinity(that)) return 1;
            return -1;
              }
              else if (Double.isNaN(that))
              {
            return 1;
              }
              else
              {
            if (val < that) return -1; return val == that ? 0 : 1;
              }
        }