Constraints on UINT_MAX (was Re: # to the nth power)

Doug Gwyn gwyn at smoke.brl.mil
Fri Nov 16 05:57:18 AEST 1990


In article <954 at mwtech.UUCP> martin at mwtech.UUCP (Martin Weitzel) writes:
>It would seem logical to me that the `pure binary representation' also
>enforces that UINT_MAX is allways one less than a power of two, ...

I think that could be concluded from the various constraints etc., but
it would be useful to get an official interpretation ruling on this.

>..., which would make `(unsigned) exponent & 1' a working
>substitute for `exponent % 2' for all values of exponent.

True, although that's relying on implementors to get it right, which
on a one's complement architecture requires extra code generation.



More information about the Comp.lang.c mailing list