I see nothing wrong with documentation being a tad pedantic, especially considering the typical target audience, even more so when it comes to things like templates, given that it's not exactly rare for non developers (graphic artists, for example) to dabble with them. Prior to your quote, the wording suggests that, although a bit silly, the example is used to illustrate the concept, I don't think the authors really meant to suggest that you should blindly follow their suggestion, but more to make a point.
Furthermore when it comes to documentation that targets PHP developers (and non developers), extreme pedantry is almost required, PHP has a notoriously low entry barrier and consequently the ecosystem is filled with crap code. I haven't looked at Drupal's codebase in years, but the last time I remember doing so, it was mostly super glue and duct tape, not Wordpress bad mind you, but still I was amazed it even worked. I'll venture a guess and say that the pedantry in the documentation is probably a direct consequence of the... not ideal state of the project's codebase.
At the same time though, you make a fair point, and the quote you isolated feels a bit dogmatic. Separating logic from presentation is an abstract principle, and thus open to interpretation and affected by various constraints. Similarly, MVC, the main expression of the principle, at least in web development, is an architectural pattern, or perhaps more accurately a tiered architectural model with three main components and without a canonical, or "pure", implementation. There are no "holy grails" in this, as there are no "holy grails" in anything in software development, our profession is one of trade-offs.
It's nearly impossible to say how much the application of two basic arithmetic operators within a presentation layer will actually affect your application, unless we know exactly what you're building and what exactly will depend on that math. Will the math need to change at a later time, for example? And if so, will you remember that this small, but perhaps crucial piece of code is not where it's supposed to be, two years after you've written it? I'm assuming here that you practice separation of program logic and presentation in general, and because of that you've trained yourself, perhaps unwittingly, to expect things to be in a certain place.
If you are confident that you are just doing a simple operation, that will probably never change and nothing important depends on it, I'd say feel free to put it wherever you want. Sure, purists will bark, some of them will probably feint, but who cares? I've said it before and I'll say it again, perfectionism is not a goal in itself, keep it simple, stupid!