Hi there, I have a question about coding with single precision floating point numbers (i.e, float)...how can I sum a certain number of floating pt #s within an interval...let's say I want to add a 100 numbers, starting from 1 within the interval [1,2) ? Anybody knows how can this be done? Any info would be greatly appreciated!
How about something like the following: Code: float total=0; for (int i=0; i<100; i++) total+= some_number();
I think he meant something more like this: Code: float x; float sum = 0.0; for (x = 1.00; x < 2.00; x += 0.01) sum += x; printf ("%.2f\n", sum); // this rounds the result