@[email protected] to Programming [email protected]English • edit-27 months agoGod I wish there was an easier way to do thisprogramming.devimagemessage-square52fedilinkarrow-up1206arrow-down121
arrow-up1185arrow-down1imageGod I wish there was an easier way to do thisprogramming.dev@[email protected] to Programming [email protected]English • edit-27 months agomessage-square52fedilink
minus-squareMuchPineappleslinkfedilink8•edit-27 months agoThis is the way. Modulo takes too long to compute, bitwise compare should be a lot faster. return !(number & 0x1);
minus-squarerecursive_recursion [they/them]linkfedilinkEnglish5•edit-27 months agooh shit yo this comment chain is pretty awesome, I learned a lot from this thanks!
return !(number & 1);
This is the way. Modulo takes too long to compute, bitwise compare should be a lot faster.
return !(number & 0x1);
oh shit yo
this comment chain is pretty awesome, I learned a lot from this thanks!