Skip to content

Commit

Permalink
Do not treat int division as a special case
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Feb 3, 2025
1 parent f3c3919 commit f769103
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions ufl/algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,7 @@ def evaluate(self, x, mapping, component, index_values):
a, b = self.ufl_operands
a = a.evaluate(x, mapping, component, index_values)
b = b.evaluate(x, mapping, component, index_values)
# Cast into python types as float(np.complex) only throws a warning
a = complex(a)
b = complex(b)
# Avoiding integer division by casting to float
try:
e = float(a) / float(b)
except TypeError:
e = a / b
return e
return a / b

def __str__(self):
"""Format as a string."""
Expand Down

0 comments on commit f769103

Please sign in to comment.