• EvokerKing@lemmy.world
    link
    fedilink
    arrow-up
    7
    arrow-down
    2
    ·
    1 年前

    Explanation: the percent is modulus. Basically it’s just divide the first number by the second and return the remainder. If you do number % 2, it will return 1 if it is odd and 0 if it is even. For example 4/2 has a remainder of 0 and therefore is even. 3/2 has a remainder of 1, and therefore is odd.