• maybe with numbers beware that bitwise and may not behave exactly as &&, see true & 4 below (true is conveted to value 1 and 1&4=0) so it makes sense to convert numbers into bool expression like you did with E.getBattery()<10 so if (width & whatever) should better be if (width>0 & whatever)

    >false & 5
    =0
    >true & 5
    =1
    >true & 4
    =0
    >true & 4!=0
    =1
    
About

Avatar for fanoush @fanoush started