Beispiel #1
0
        /// <summary>
        /// Get real solutions.
        /// </summary>
        /// <param name="equation"> Equation </param>
        public static void GetRealSolutions(Quadratic equation)
        {
            if (equation.Discriminant < 0)
            {
                return;
            }

            PrintEquation(equation);

            Console.WriteLine($"Roots: Х1 = {equation.X1,3:g3} \tX2 = {equation.X2,3:g3}");
            Console.WriteLine("------------------------------------------");
        }
Beispiel #2
0
 /// <summary>
 /// Return info about equation.
 /// </summary>
 /// <param name="equation"> Info about equation </param>
 public static void PrintEquation(Quadratic equation) =>
 Console.WriteLine($"{equation}; Discriminant = {equation.Discriminant:g3}\n");