jinja2cpp/Jinja2Cpp

Incorrect results returned by the remainder operator %

Closed this issue · 0 comments

Jinja2Cpp's % operator differs from % of the original Jinja library.
For example the expression {{ 11 % 7 }} in Jinja shows -3, while the original Jinja shows 4.

Here is a link to the documentation of the original Jinja:
% Calculate the remainder of division. For instance, 11 % 7 returns 4.

The reason why Jinja2Cpp differs from the original Jinja is because Jinja2Cpp uses std::remainder instead of std::fmod

I will prepare a PR that fixes this bug.