public IActionResult Index(int?dp = 6)
        {
            var stopwatch = Stopwatch.StartNew();

            var pi = MachinFormula.Calculate(dp.Value, _metricsEnabled);

            var model = new PiViewModel
            {
                DecimalPlaces       = dp.Value,
                Value               = pi.ToString(),
                ComputeMilliseconds = stopwatch.ElapsedMilliseconds,
                ComputeHost         = Environment.MachineName
            };

            return(View(model));
        }
Esempio n. 2
0
        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 PiViewModel
            {
                DecimalPlaces       = dp.Value,
                Value               = pi.ToString(),
                ComputeMilliseconds = stopwatch.ElapsedMilliseconds,
                ComputeHost         = Environment.MachineName
            };

            return(View(model));
        }