minus-squaredadarobot@lemmy.sdf.orglinkfedilinkarrow-up18·2 months agoIf number%2 == 0: return("Even") Else: return("odd")
minus-squareistdaslol@feddit.orglinkfedilinkarrow-up5·2 months 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")
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.
Deleted