public void Add(int newFactor) { InAList.Add(newFactor); if (InAList.Count > 0 && InAList.Last() > newFactor) { throw new Exception("Your list is out of order!"); } if (newFactor == lastFactor || newFactor == 2) { consecutiveFactorCounter++; } else { AsExponents.Add(new Value((double)lastFactor, (double)consecutiveFactorCounter, NumberType.exponent, Restrictions.dontFactorDontSetFraction)); consecutiveFactorCounter = 0; } lastFactor = newFactor; }
public void Flush() { AsExponents.Add(new Value((double)lastFactor, (double)consecutiveFactorCounter + 1, NumberType.exponent, Restrictions.dontFactorDontSetFraction)); Count = InAList.Count(); }
public void Flush() { AsExponents.Add(new Value((double)lastFactor, (double)consecutiveFactorCounter + 1, NumberType.exponent)); Count = InAList.Count(); }