• Kraiden@kbin.earth
    link
    fedilink
    arrow-up
    2
    ·
    22 hours ago

    you might be able to do it with a bitwise op? My track record tonight is not great so I’m not going to comment. Have a look at @ImplyingImplactions comment for a loopless solution

    • UID_Zero@infosec.pub
      link
      fedilink
      English
      arrow-up
      2
      ·
      19 hours ago

      Bitwise and with 0x1. If result is 0, it’s even. Least significant bit is always 1 for odd numbers.