• 257m@sh.itjust.works
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    11 months ago
    number % 2 == 0
    and
    (number & 0b1) == 0
    

    Are the only sane ways to do this. No need to floor. Although If its C and you can’t modulo floats then (number/2 == floor(number/2))