• jeff 👨‍💻@programming.dev
    link
    fedilink
    English
    arrow-up
    9
    ·
    3 days ago

    You are misunderstanding what the remainder is.

    5 % 2 == 1, because 5 == 2 x 2 + 1

    10 % 7 == 3, because 10 == 1 x 7 + 3

    Your “edit 2” is mostly correct. I don’t think of it “undoing” the division. But if that makes sense to you then I guess it’s fine