5 // Miguel de Icaza (miguel@ximian.com)
7 // (C) Ximian, Inc. http://www.ximian.com
10 using System.Globalization;
14 public struct UInt64 : IComparable, IFormattable { //, IConvertible {
15 public const ulong MaxValue = 0xffffffffffffffff;
16 public const ulong MinValue = 0;
20 public int CompareTo (object v)
22 if (!(v is System.UInt64))
23 throw new ArgumentException ("Value is not a System.UInt64");
25 if (value == (ulong) v)
28 if (value < (ulong) v)
34 public override bool Equals (object o)
36 if (!(o is System.UInt64))
39 return ((ulong) o) == value;
42 public override int GetHashCode ()
44 return (int)(value & 0xffffffff) ^ (int)(value >> 32);
47 public static ulong Parse (string s)
49 return Parse (s, NumberStyles.Integer, null);
52 public static ulong Parse (string s, IFormatProvider fp)
54 return Parse (s, NumberStyles.Integer, fp);
57 public static ulong Parse (string s, NumberStyles style)
59 return Parse (s, style, null);
62 public static ulong Parse (string s, NumberStyles style, IFormatProvider fp)
68 public override string ToString ()
70 return ToString ("G", null);
73 public string ToString (IFormatProvider fp)
75 return ToString ("G", fp);
78 public string ToString (string format)
80 return ToString (format, null);
83 public string ToString (string format, IFormatProvider fp)
85 // TODO: Implement me.
89 // =========== IConvertible Methods =========== //
91 public TypeCode GetTypeCode ()
93 return TypeCode.UInt64;