5 // Miguel de Icaza (miguel@ximian.com)
7 // (C) Ximian, Inc. http://www.ximian.com
10 using System.Globalization;
14 public struct Int32 : IComparable, IFormattable { //, IConvertible {
15 public const int MaxValue = 0x7fffffff;
16 public const int MinValue = -2147483648;
20 public int CompareTo (object v)
22 if (!(v is System.Int32))
23 throw new ArgumentException ("Value is not a System.Int32");
25 return value - (int) v;
28 public override bool Equals (object o)
30 if (!(o is System.Int32))
33 return ((int) o) == value;
36 public override int GetHashCode ()
41 public static int Parse (string s)
43 return Parse (s, NumberStyles.Integer, null);
46 public static int Parse (string s, IFormatProvider fp)
48 return Parse (s, NumberStyles.Integer, fp);
51 public static int Parse (string s, NumberStyles style)
53 return Parse (s, style, null);
56 public static int Parse (string s, NumberStyles style, IFormatProvider fp)
62 public override string ToString ()
64 return ToString ("G", null);
67 public string ToString (IFormatProvider fp)
69 return ToString ("G", fp);
72 public string ToString (string format)
74 return ToString (format, null);
77 public string ToString (string format, IFormatProvider fp)
79 // TODO: Implement me.
83 // =========== IConvertible Methods =========== //
85 public TypeCode GetTypeCode ()
87 return TypeCode.Int32;