nave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 2 years agoI wishi.imgur.comexternal-linkmessage-square187fedilinkarrow-up1932
arrow-up1932external-linkI wishi.imgur.comnave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 2 years agomessage-square187fedilink
minus-squaredwalin@lemmy.worldlinkfedilinkarrow-up22·2 years agoJust do a recursive funcion subtracting 2 and stoping on -1 or 0. Easy
minus-squaredwalin@lemmy.worldlinkfedilinkarrow-up2·2 years agoOk, thanks for the PR. I added a condition if we have an underflow we increment it instead
minus-squareFooBarrington@lemmy.worldlinkfedilinkarrow-up2·2 years agoJust return null, nobody knows whether negative numbers can be even
Just do a recursive funcion subtracting 2 and stoping on -1 or 0. Easy
dwalinIsEven(-2)
Ok, thanks for the PR. I added a condition if we have an underflow we increment it instead
Just return
null
, nobody knows whether negative numbers can be even