Re: Should %d round?
- Posted by gbonvehi Mar 19, 2012
- 1850 views
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