[EMAIL PROTECTED] (Paul Jarc) wrote: > Paul Eggert <[EMAIL PROTECTED]> wrote: >> /* Bound on length of the string representing an integer value or type T. >> Subtract 1 for the sign bit if t is signed; log10 (2.0) < 146/485; >> add 1 for integer division truncation; add 1 more for a minus sign >> if needed. */ >> #define INT_STRLEN_BOUND(t) \ >> ((sizeof (t) * CHAR_BIT - 1) * 146 / 485 + 2) > > I guess that should be: > #define INT_STRLEN_BOUND(t) \ > ((sizeof (t) * CHAR_BIT - TYPE_SIGNED(t)) * 146 / 485 + TYPE_SIGNED(t) + 1)
Technically, yes, but that would prohibit applying that macro to variables, which is useful. Currently there are uses like that in the coreutils. _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
