[courier-users] maxlongsize may be a 64-bit portability issue
Brought to you by:
mrsam
From: Alessandro V. <ve...@ta...> - 2004-09-29 15:55:02
|
The maxlongsize.h header used to define the max size of a decimal representation of the largest long int using the size of its string representation as given in limits.h, i.e. (simplified slightly) #define MAXLONGSIZE MAXLONGSIZE1(ULONG_MAX) #define MAXLONGSIZE1(x) MAXLONGSIZE2(x) #define MAXLONGSIZE2(x) sizeof( # x ) However, the max in limits.h can be given in hex format, e.g. 0xffffffff rather than 4294967295. Note that since hex format requires two extra chars "0x", it will not be shorter than the equivalent decimal representation unless the number has 40 or more bits. OT: Why 40? I couldn't do better than solve 2 + log16(x) = log10(x), approx. 2^39.2 |