You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sum filter uses floating-point accumulation for integer inputs, which can silently change the total.
{{ [9007199254740993, 2] | sum }}
Python Jinja2 returns:
9007199254740995
The affected Go implementation returns:
9007199254740994
Every input and the correct total fit within the supported integer range, so this isn’t an overflow case. We’re losing precision by taking integer arithmetic through floating point.
I’m preparing a PR to use the engine’s existing value-addition operation for accumulation. That keeps integer inputs in integer arithmetic and allows floating-point promotion when required. I’ll attach it here with a regression test checking the exact rendered result. This change won’t add arbitrary-precision integers or address integer overflow beyond the engine’s existing behaviour.
Resolved in #34 and published in v1.11.0, with corresponding regression tests covering the reported problem. Thank you, @qoke, for the report and suggested solution.
Activity
ardan-bkennedy commentedon Oct 26, 2026
Resolved in #34 and published in v1.11.0, with corresponding regression tests covering the reported problem. Thank you, @qoke, for the report and suggested solution.