Столкнулся с небольшим недопониманием. Почему на шестой итерации цикла в итератор попадает мусор (-5.55111..)? А должен быть 0. Код программы:
using System;
namespace frost1
{
class Program
{
static void Main()
{
double a, b, h;
Console.WriteLine("Input please the A variable (bottom):");
a = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Input please the B variable (top):");
b = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Input please the H (step) variable:");
h = Convert.ToDouble(Console.ReadLine());
if (a >= b) Console.WriteLine("Wrong interval... Repeat the input");
else
{
double res = 0;
Console.WriteLine("x\t\t\ty");
for (double i = a; i <= b; i+=h)
{
res = Math.Pow(i, 2) - Math.Sin(Math.Pow(i,4));
Console.WriteLine(i+"\t\t\t"+res);
}
}
}
}
}
Скриншот:

-5.55111, а-0.0000000000000000555111. – VladD Jun 22 '16 at 12:13