Comment on I wish
dwalin@lemmy.world 1 year ago
Just do a recursive funcion subtracting 2 and stoping on -1 or 0. Easy
dwalinIsEven(-2)
Just return null, nobody knows whether negative numbers can be even
null
Ok, thanks for the PR. I added a condition if we have an underflow we increment it instead
fox_the_apprentice@lemmynsfw.com 1 year ago
dwalinIsEven(-2)
FooBarrington@lemmy.world 1 year ago
Just return
null
, nobody knows whether negative numbers can be evendwalin@lemmy.world 1 year ago
Ok, thanks for the PR. I added a condition if we have an underflow we increment it instead