Jinja2Cpp icon indicating copy to clipboard operation
Jinja2Cpp copied to clipboard

Incorrect results returned by the remainder operator %

Open MeanSquaredError opened this issue 4 months ago • 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.

MeanSquaredError avatar Oct 20 '24 09:10 MeanSquaredError