示例#1
0
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            if (GetType() != obj.GetType())
            {
                throw new ArgumentException("Cannot compare, types differ");
            }

            var n = (Number)obj;

            return(AsFloatingPt.CompareTo(n.AsFloatingPt));
        }