public void CalculatorTest(double firstValue, double expected) { var calculator = new TenPower(); var actualResult = calculator.Calculate(firstValue); Assert.AreEqual(expected, actualResult); }
public static TenPower GetInstance(int index) { TenPower result = _cache[index]; if (result == null) { result = new TenPower(index); _cache[index] = result; } return(result); }
public void multiplyByPowerOfTen(int pow10) { TenPower tp = TenPower.GetInstance(Math.Abs(pow10)); if (pow10 < 0) { mulShift(tp._divisor, tp._divisorShift); } else { mulShift(tp._multiplicand, tp._multiplierShift); } }
public static TenPower GetInstance(int index) { TenPower result = _cache[index]; if (result == null) { result = new TenPower(index); _cache[index] = result; } return result; }