public void AtanTest(double argument, double result) { var calculator = new Atan(); var testResult = calculator.Calculate(argument); Assert.AreEqual(result, testResult); }
public void AtanTest(double first, double second, double expected) { ITwoArgumentsCalculator calculator = new Atan(); double result = calculator.Calculate(first, second); Assert.AreEqual(expected, result); }
public void Go() { var stopwatch = Stopwatch.StartNew(); HighPrecision.Precision = _dp; HighPrecision first = 4 * Atan.Calculate(5); HighPrecision second = Atan.Calculate(239); var pi = 4 * (first - second); stopwatch.Stop(); WriteLine($"I calculated Pi to {_dp} decimal places in {stopwatch.ElapsedMilliseconds}ms. The last digit is {pi.ToString().Last()}."); }
public IActionResult Index(int?dp = 6) { var stopwatch = Stopwatch.StartNew(); HighPrecision.Precision = dp.Value; HighPrecision first = 4 * Atan.Calculate(5); HighPrecision second = Atan.Calculate(239); var pi = 4 * (first - second); var model = new PiModel { DecimalPlaces = dp.Value, Value = pi.ToString(), ComputeMilliseconds = stopwatch.ElapsedMilliseconds, ComputeHost = Environment.MachineName }; return(View(model)); }