Source/NFX/IntMath.cs
/// <summary>
/// Increases a capacity to a prime number by the factor. Both numbers must be positive
/// </summary>
Increases a capacity to a prime number by the factor. Both numbers must be positive
Increases a capacity to a prime number by the factor . Both numbers must be positive
public static int GetCapacityFactoredToPrime(int capacity, double factor)
        {
          if (capacity<0 || factor<0d)
            throw new NFXException(StringConsts.ARGUMENT_ERROR+"GetCapacityFactoredToPrime(capacity|factor<0|1.0d)");
          var newCapacity = capacity * factor;
          if (newCapacity>int.MaxValue)
           capacity = 2146435069;
          else
           capacity = (int)newCapacity;
          return GetPrimeCapacityOfAtLeast(capacity);
        }
public static int GetCapacityFactoredToPrime ( int capacity , double factor ) { if ( capacity < 0 || factor < 0d ) throw new NFXException ( StringConsts . ARGUMENT_ERROR + " " ) ; var newCapacity = capacity * factor ; if ( newCapacity > int . MaxValue ) capacity = 2146435069 ; else capacity = ( int ) newCapacity ; return GetPrimeCapacityOfAtLeast ( capacity ) ; }
Increases a capacity to a prime number by the factor.
Increases a capacity to a prime number by the factor .
capacity
int
factor
double