Exemple #1
0
 public override string ToString()
 {
     if (IsFloatingPt)
     {
         return(AsFloatingPt.ToString());
     }
     return(AsInt.ToString());
 }
Exemple #2
0
        public override int GetHashCode()
        {
            if (_hash != null)
            {
                return(_hash.Value);
            }

            _hash = AsFloatingPt.GetHashCode();
            return(_hash.Value);
        }
Exemple #3
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));
        }