• Acters@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    Nice, how about bitwise & operator?

    // n&1 is 1, then odd, else even
    
    return (!(n & 1));