Re: Should %d round?
- Posted by AJ_Oxley Mar 20, 2012
- 1795 views
gbonvehi said...
petelomax said...
Further to a recent post, I would like to solicit general opinion on whether
printf(1,"%d\n",3.9999999)
should print 3 (as it does now) or 4?
I would leave it as it is and state clearly in the manual that the %d argument using an atom will print only the integer part.
If it needs to be rounded, round it :)
Cheers, Guillermo
Sounds fine to me too :) But highlight it perhaps, or add it to the common (possible?) mistakes section.