static void Main() { double rmi = -5, rma = 5; myFunction sin = new myFunction(0, Math.PI); double s = 0, del = 0.001; for (double x = rmi; x < rma; x += del) { s += sin[x]; } s *= del; Console.WriteLine(s); Console.ReadKey(); }
static void Main() { double rmi = -5, rma = 5; myFunction sin = new myFunction(0, Math.PI); double s = 0, del = 0.001; for (double i = rmi; i <= rma; i += del) { s += sin[i] * del; } Console.WriteLine(s); Console.ReadKey(); }