• Kraiden@kbin.earth
    link
    fedilink
    arrow-up
    3
    ·
    1 month 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
      3
      ·
      1 month ago

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