• tipicaldik@lemmy.world
    link
    fedilink
    arrow-up
    14
    arrow-down
    1
    ·
    15 hours ago

    I remember coding actionscript in Flash and using modulo (%) to determine if a number was even or odd. It returns the remainder of the number divided by 2 and if it equals anything other than 0 then the number is odd.

    • Korne127@lemmy.world
      link
      fedilink
      arrow-up
      19
      ·
      14 hours ago

      Yeah. The joke is that this is the obvious solution always used in practise, but the programmer is that bad that they don’t know it and use some ridiculous alternative solutions instead.