2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 5 Mar 2010 03:33:00 +0000 (03:33 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 5 Mar 2010 03:33:00 +0000 (03:33 -0000)
* BigInteger.cs: Implement IComparable and IEquatable.

svn path=/trunk/mcs/; revision=153074

mcs/class/System.Numerics/System.Numerics/BigInteger.cs
mcs/class/System.Numerics/System.Numerics/ChangeLog

index 8eeac79f602871e7cc267b00943b257374230d94..5d519b1023110ba049c2aeae52e4f080d2fa55da 100644 (file)
@@ -39,7 +39,7 @@ Optimization
        CoreAdd could avoid some resizes by checking for equal sized array that top overflow
 */\r
 namespace System.Numerics {\r
-       public struct BigInteger
+       public struct BigInteger : IComparable<BigInteger>, IEquatable<BigInteger>
        {
                //LSB on [0]
                readonly uint[] data;
@@ -358,8 +358,11 @@ namespace System.Numerics {
                {
                        if (!(obj is BigInteger))
                                return false;
-                       BigInteger other = (BigInteger)obj;
+                       return Equals ((BigInteger)obj);
+               }
 
+               public bool Equals (BigInteger other)
+               {
                        if (sign != other.sign)
                                return false;
                        if (data.Length != other.data.Length)
index 1c2ac556903de90df34a89df9346241a05c7b13a..e6779f288d1137d66f2718d46e57ee6e668fb436 100644 (file)
@@ -1,3 +1,7 @@
+2010-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * BigInteger.cs: Implement IComparable and IEquatable.
+
 2010-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * BigInteger.cs: Compare and relational ops.