public override string ToString() { if (IsFloatingPt) { return(AsFloatingPt.ToString()); } return(AsInt.ToString()); }
public override int GetHashCode() { if (_hash != null) { return(_hash.Value); } _hash = AsFloatingPt.GetHashCode(); return(_hash.Value); }
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)); }