Re: portable way to get highest bit set?

Bart <[email protected]> Thu, 12 Oct 2023 01:35:03 +0100
Newsgroups comp.lang.c,alt.comp.lang.c
Organization A noiseless patient Spider
Message-ID <[email protected]>
On 12/10/2023 01:25, candycanearter07 wrote:
> On 10/11/23 13:02, Richard Harnden wrote:
>> Why 0x100000000 and not 0x800000000?
> 
> Wait, how do you specify a binary constant again?

Use 0b rather than 0x. But without numeric separators, you will need to 
count carefully if you have up to 64 bits.

Easier might be to write 1U<<31 or 1ULL<<63.