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

    Nice, how about bitwise & operator?

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