Persona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 17 days agoRulelemmy.blahaj.zoneimagemessage-square53fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageRulelemmy.blahaj.zonePersona3Reload@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 17 days agomessage-square53fedilink
minus-squaredadarobot@lemmy.sdf.orglinkfedilinkarrow-up0·17 days agoIf number%2 == 0: return("Even") Else: return("odd")
minus-squareistdaslol@feddit.orglinkfedilinkarrow-up0·16 days agoNot all ARM CPUs support mod operations. It’s better to use bit operations. Check if the last bit is set. If set it’s odd else it’s even.
If number%2 == 0: return("Even") Else: return("odd")
I came here to post this
Not all ARM CPUs support mod operations. It’s better to use bit operations. Check if the last bit is set. If set it’s odd else it’s even.