When the following code is executed, the loop does not run when f == 2.0
Why wouldn't it?
last line of output from program:
float f = .1;
while (f <= 2.0)
printf("%.1f*Pi: sin() = %f cos() = %f tan() = %f\n",
f += .1;
printf("\nf now equals %f",f);
I also tried to see if this statement returned a true value:
1.9*Pi: sin() = -0.309016 cos() = 0.951057 tan() = -0.324919
f now equals 2.000000
..and it did, so I have no idea why my loop only runs until f == 1.9
I know I could eliminate the problem by changing my loop to:
But i'm curious as to why it isn't working as is.
Thank you for any help.