Index: lib/inttostr.h =================================================================== RCS file: /cvsroot/gnulib/gnulib/lib/inttostr.h,v retrieving revision 1.2 diff -u -r1.2 inttostr.h --- lib/inttostr.h 12 Apr 2004 06:47:06 -0000 1.2 +++ lib/inttostr.h 25 Feb 2005 06:36:01 -0000 @@ -36,8 +36,11 @@ #endif /* Upper bound on the string length of an integer converted to string. - 302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit; - add 1 for integer division truncation; add 1 more for a minus sign. */ + 302 / 1000 >= log10(2.0), subtract 1 for the sign bit; add 1 for + integer division truncation; add 1 more for a minus sign. + (There is no need to have a separate macro for unsigned types, as + it would be ((sizeof (t) * CHAR_BIT) * 302 / 1000 + 1), which is + either the same, or smaller by 1.) */ #define INT_STRLEN_BOUND(t) ((sizeof (t) * CHAR_BIT - 1) * 302 / 1000 + 2) #define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)