Sentient Loom@sh.itjust.works to Lemmy Shitpost@lemmy.worldEnglish · 7 hours agoDon't tell me what to dosh.itjust.worksimagemessage-square7fedilinkarrow-up192
arrow-up192imageDon't tell me what to dosh.itjust.worksSentient Loom@sh.itjust.works to Lemmy Shitpost@lemmy.worldEnglish · 7 hours agomessage-square7fedilink
minus-squareSnazz@lemmy.worldlinkfedilinkarrow-up2·edit-21 hour agoThere are only 4.29 billion possible values of an int32, so even if you used 2 lines for each case, it’d still be under 10 billion lines of code bool isOdd(int num) if (num == 1) { return true; } if (num == 2) { return false; } …
minus-squareSentient Loom@sh.itjust.worksOPlinkfedilinkEnglisharrow-up1·26 minutes agookay but what about an int512?
smallest isOdd function
There are only 4.29 billion possible values of an int32, so even if you used 2 lines for each case, it’d still be under 10 billion lines of code
bool isOdd(int num) if (num == 1) { return true; } if (num == 2) { return false; } …
okay but what about an
int512
?