From c4223fc48ed79e72f3a5d94391c55a1fd6ddb670 Mon Sep 17 00:00:00 2001 From: Dominic Kempf Date: Fri, 18 May 2018 15:20:09 +0200 Subject: [PATCH] [bugfix] Correct mod implementation for right operand being 1 In fact x % 1 is 0, not x. --- pymbolic/primitives.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymbolic/primitives.py b/pymbolic/primitives.py index 39e6bdb..95ea4c1 100644 --- a/pymbolic/primitives.py +++ b/pymbolic/primitives.py @@ -321,7 +321,7 @@ class Expression(object): return NotImplemented if is_zero(other-1): - return self + return 0 return Remainder(self, other) def __rmod__(self, other): -- GitLab