• Knusper@feddit.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    Had to think about it, but yeah, I guess, you can’t do division or non-integer multiplication with integer cents, as standard integer math always rounds downwards and it forces you to round after every step.
    You could convert to a float for the division/multiplication and you do get more efficient addition/subtraction as well as simpler de-/serialization, but in most situations, it’s probably less trouble to use decimals.