Why does the compilation in the next step after "-0.1" go "-1.38 ...", and then "0.999 ..."?
using System; namespace OOP_Lab_3 { class Program { static void Main(string[] args) { double x1, x2, step, eps, amount, func, x, value; int n; //Ввод данных пользователем Console.WriteLine("Eps= "); eps = 0.0001; // Convert.ToDouble(Console.ReadLine()); Console.WriteLine("x begin= "); x1 = -1; //Convert.ToDouble(Console.ReadLine()); Console.WriteLine("x end= "); x2 = 0.9; // Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Step= "); step = 0.1; // Convert.ToDouble(Console.ReadLine()); Console.WriteLine(); for (x = x1; x <= x2; x += step) { n = 1;// value = eps + 1; value = 1; amount = 0; while (eps <= Math.Abs(value)) { value = -Math.Pow(x, n) / n; amount += value; n++; } func = Math.Log(1 - x); //Функция //вывод Console.WriteLine("\tx= " + x + "\ty= " + amount + "\tn= " + n + "\t auto= " + (Math.Round(func, 10))); Console.WriteLine(); } Console.ReadKey(); Console.ReadKey(); } } } 