using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CalculatorLib { public class Calculator { /// /// Вычисляет ответ задания /// /// Переменная x /// Переменная y /// Переменная z /// Указатель на переменную успеха /// Ответ задания public static double CalculateAnswer(double x, double y, double z, ref bool success) { double output = 0.00d; try { output += Math.Pow(2, Math.Pow(y, x)); output += Math.Pow(Math.Pow(3, x), y); output -= (y * (Math.Atan(z) - Math.PI / 6)) / (Math.Abs(x) + 1 / (y * y - 1)); success = true; } catch (DivideByZeroException) { success = false; } return output; } } }