Sentient Loom@sh.itjust.works to Lemmy Shitpost@lemmy.worldEnglish · 2 days agoDon't tell me what to dosh.itjust.worksexternal-linkmessage-square19fedilinkarrow-up1134arrow-down15
arrow-up1129arrow-down1external-linkDon't tell me what to dosh.itjust.worksSentient Loom@sh.itjust.works to Lemmy Shitpost@lemmy.worldEnglish · 2 days agomessage-square19fedilink
minus-squareSnazz@lemmy.worldlinkfedilinkarrow-up6·edit-21 day 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; } if (num == 3) { return true; } … }
minus-squareSentient Loom@sh.itjust.worksOPlinkfedilinkEnglisharrow-up3·1 day agookay but what about an int512?
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; } if (num == 3) { return true; } … }
okay but what about an
int512
?