Hi guys, I have the following piece of code but I am not sure I understand if I get what it does correctly.(adsbygoogle = window.adsbygoogle || []).push({});

In fact I'm trying to understand the conditional. It says that if max is greater or equal to (1 <<9) it should do something. right?Code (C):

static const unsigned int m_nBits = 6;

static const unsigned int m_nRanges = 4;

max = SOMENUMBER;

if( max >= (1 << (m_nBits + m_nRanges - 1) ) ){

doStuff()

}

1<<9 =(01)<< 9 =(1000000000)= 2^{9}= 512 right?

(i bolded the binary numbers).

So the if statement will be executed if the value of max is larger or equal to 512?

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# C/++/# Bitwise Operators C++

Have something to add?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**