Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (1)
......@@ -391,6 +391,8 @@ class CustomSympyPrinter(CCodePrinter):
if isinstance(arg, sp.Number) and arg.is_finite:
return self._typed_number(arg, data_type)
else:
if str(arg) == "-1":
print("!!")
return "((%s)(%s))" % (data_type, self._print(arg))
elif isinstance(expr, fast_division):
return "({})".format(self._print(expr.args[0] / expr.args[1]))
......
......@@ -550,7 +550,7 @@ def get_type_of_expression(expr,
return result
elif isinstance(expr, sp.Pow):
base_type = get_type(expr.args[0])
if expr.exp.is_integer:
if expr.exp.is_integer or expr.exp == sp.Rational(1, 2):
return base_type
else:
return collate_types([create_type(default_float_type), base_type])
......