• Kraiden
    link
    fedilink
    213 days 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

    • @[email protected]
      link
      fedilink
      English
      213 days ago

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