The code below is supposed to calculate the area under the curve. I managed to get the code to work by setting delta to 1 or even smaller numbers like 0.25 and 0.50. However, when I make the size of delta even smaller, the program will take forever to run. Any ideas?
which begs a general point: you don't usually want to compare doubles for equality or inequality. You can look up walls of text as to what happens, why it happens, and what to do when you get a chance.