As far as I can tell under D&D 5E rules, you ALWAYS round down any time you get a fraction. Even if the fraction is 0.9, you round it down.
Please quote that rule here. And if true, then, it means D&D doesn't understand math.
There's one more general rule you need to know at the outset. Whenever you divide a number in the game, round down if you end up with a fraction, even if the fraction is one-half or greater.
- Page 7 (Introduction) of PH 5e.
It has absolutely nothing to do with (not) understanding math. Perfectly normal for e.g. a software developer.
Look, the operation is this: 4 * ((4 - 1)/2 + 1)
Before you think about rounding a number, or throw a D&D card rule on the table, you run the operation as-is. Once you get "the final answer" then you can add whatever gaming rules that pleases you.
And that's how it should be treated by a compiler - at least that's how google treats it.