It’s not wrong, its called epsilon error. This is a byproduct of how computers work when rounding. All coding languages do this on every computer everywhere. It’s just that you normally don’t see this kind of thing because programmers hide it behind the UI.
If you are really worried about numbers beyond the 10th decimal place.
{%set value = 20.1%}
{% set value2 = value + 0.8 | round(1)%}
{{ "{:f}".format(value2) | float }}
Mainly what @petro said. But for this particular expression, it’s correct. The float and round filters apply to 0.8. So, 0.8 converted to float is still 0.8, and then round with no parameters means round to nearest and change to int, so it becomes 1. Which, when added to 20.1 results in 21.1.
I think maybe you meant to do this instead:
{% set value = 20.1%}
{{ (value + 0.8) | float | round }}
Which results in 21. (BTW, the float filter is unnecessary here, since value and 0.8 are both already floats.)