• Acters@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    8 months ago

    Nice, how about bitwise & operator?

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