Determine if int is not 0 with no if statements

this assumes 32bit int’s

((static_cast<unsigned>(-(array[0]*array[0]))&(1ul<<31))>>31)

Leave a Comment