robertwessel2@y ahoo.com wrote:
#include <limits.h>
#define L (ULLONG_MAX / UCHAR_MAX)
#define H (L << (CHAR_BIT - 1))
--
Eric.Sosman@sun .com
On Oct 16, 11:35 am, jacob navia <ja...@nospam.c omwrote:
Nice. And the adaptations to other size operands (32 bit longs for
platforms not supporting anything bigger than that) or wide characters
are obvious. Too bad I don't see a way of generating the constants in
a platform independent way.
>[...]
>#define H 0x8080808080808 080ULL
>#define L 0x0101010101010 101ULL
>[...]
>#define H 0x8080808080808 080ULL
>#define L 0x0101010101010 101ULL
>[...]
platforms not supporting anything bigger than that) or wide characters
are obvious. Too bad I don't see a way of generating the constants in
a platform independent way.
#define L (ULLONG_MAX / UCHAR_MAX)
#define H (L << (CHAR_BIT - 1))
--
Eric.Sosman@sun .com