9
lorentz
7y

float integral = 0;
float dx=float.minValue;
for (float x = a; x<=b; x+=dx) {
integral+=f(x)*dx;
}

A classmate just literally wrote this and he believed it was the proper way to do it.
I asked him to integrate f(x)=1 on 0<x<1.

Comments
Add Comment