Sentient Loom@sh.itjust.works to Lemmy Shitpost@lemmy.worldEnglish · 10 days agoDon't tell me what to dosh.itjust.worksexternal-linkmessage-square17fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkDon't tell me what to dosh.itjust.worksSentient Loom@sh.itjust.works to Lemmy Shitpost@lemmy.worldEnglish · 10 days agomessage-square17fedilink
minus-squareSnazz@lemmy.worldlinkfedilinkarrow-up0·edit-210 days 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-up0·10 days 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
?