Beispiel #1
0
        CreateContractedBigIntegerWithLotsOfInformation(uint numberOfDigits)
        {
            Contract.Requires <ArgumentException>(
                numberOfDigits > 0, NumberGenerator.ErrorInvalidNumberOfDigits);
            Contract.Ensures(
                Contract.Result <Tuple <BigInteger, DateTime, Guid> >() != null);

            return(NumberGenerator.CreateBigIntegerWithLotsOfInformation(numberOfDigits));
        }
Beispiel #2
0
        public static BigInteger CreateBigInteger(uint numberOfDigits, CreationOptions options)
        {
            var result = NumberGenerator.CreateBigInteger(numberOfDigits);

            if (options == CreationOptions.CreateOdd && result.IsEven)
            {
                result--;
            }
            else if (options == CreationOptions.CreateEven && !result.IsEven)
            {
                result++;
            }

            return(result);
        }
Beispiel #3
0
 CreateBigIntegerWithLotsOfInformation(uint numberOfDigits)
 {
     return(new Tuple <BigInteger, DateTime, Guid>(
                NumberGenerator.CreateBigInteger(numberOfDigits),
                DateTime.UtcNow, Guid.NewGuid()));
 }