Changeset 610 for trunk/CrypPluginBase


Ignore:
Timestamp:
Sep 29, 2009, 5:25:23 PM (12 years ago)
Author:
Sven Rech
Message:

fixed BigInteger IComparable Interfaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPluginBase/Miscellaneous/BigInteger.cs

    r606 r610  
    136136namespace Cryptool.PluginBase.Miscellaneous
    137137{
    138     public class BigInteger : IComparable<BigInteger>
     138    public class BigInteger : IComparable
    139139    {
    140140        // maximum length of the BigInteger in uint (4 bytes)
     
    33583358        }
    33593359
    3360         #region IComparable<BigInteger> Members
    3361 
    3362         int IComparable<BigInteger>.CompareTo(BigInteger other)
    3363         {
     3360
     3361        #region IComparable Members
     3362
     3363        int IComparable.CompareTo(object obj)
     3364        {
     3365            BigInteger other = null;
     3366            if (obj is BigInteger)
     3367                other = (BigInteger)obj;
     3368            else if (obj is String)
     3369                other = new BigInteger(obj as String, 10);
     3370            else if (obj is Int32)
     3371                other = new BigInteger((int)obj);
     3372            else
     3373                throw new Exception("Invalid comparison with BigInteger");
     3374
    33643375            if (this == other)
    33653376                return 0;
Note: See TracChangeset for help on using the changeset viewer.