Please help me understand what's going on:
I have the following code and it does not appear to do rounding as I would expect it to:
Here's the output that I receive:Code:double val=323.700000,rval; double t=26.975; int i=12; rval = val / (double)i; printf("t = [%6.2f]\n",t); printf("t NF = [%f]\n",t); printf("rval NF = [%f]\n",rval); printf("rval WF = [%6.2f]\n",rval);
t = [ 26.98]
t NF = [26.975000]
lmp NF = [26.975000]
lmp WF = [ 26.97]
Why doesn't rval WF round the number to 26.98???