• DarkGamer
    link
    fedilink
    29 months ago

    This is why every programmer needs to understand the modulo operator.

      • @Reptorian
        link
        29 months ago

        This is what I prefer too! I also some times prefer to use bitshift when it comes to division or multiplication of power of 2.

    • MxM111
      link
      fedilink
      29 months ago

      I would divide by two (floating point) and check the fractional part.

      • @sus
        link
        69 months ago

        turns out that 2^53 + 1 is an even number