2 messages in net.sourceforge.lists.courier-users[courier-users] maxlongsize may be a ...
FromSent OnAttachments
Alessandro VeselySep 29, 2004 8:55 am 
Sam VarshavchikSep 29, 2004 4:28 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] maxlongsize may be a 64-bit portability issueActions...
From:Alessandro Vesely (ves@tana.it)
Date:Sep 29, 2004 8:55:39 am
List:net.sourceforge.lists.courier-users

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