Bug in 4.1BSD C library "printf" (actually _doprnt)

gwyn at brl-vld gwyn at brl-vld
Mon Aug 8 11:58:44 AEST 1983


From:      Doug Gwyn (VLD/VMB) <gwyn at brl-vld>

I don't think that's a bug.  "%1.0f" means use a minimum field width
of 1 character with 0 characters after the decimal point and no
decimal point, but as many characters as required left of the decimal
point.  So 10.0 converted this way would give you "10", etc.

Printf's philosophy is to never truncate significant digits.



More information about the Comp.unix.wizards mailing list