How to set the thirtysecond bit?

CBFalconer cbfalconer at
Thu Dec 28 23:45:50 CET 2006

Frank Heckenbach wrote:
... snip ...
> Please note that in Pascal, unlike C, integers represent numbers,
> not bit-patterns, so storing a 32-bit-pattern (with the topmost bit
> set) in a signed integer type, which is common practice in C, is not
> allowed in Pascal, as it would alter the numeric value.

You have a misconception about C.  Numbers are represented by
values.  The bit pattern is specified for positive and unsigned
values, which restricts the representation to binary.  However 2's
complement, 1's complement, and sign-magnitude representation is
allowed for negative values.  What you call a "common practice" is
in fact an error which is often not caught by the compiler.

Merry Christmas, Happy Hanukah, Happy New Year
        Joyeux Noel, Bonne Annee.
Chuck F (cbfalconer at maineline dot net)

More information about the Gpc mailing list