Skip to content

Commit

Permalink
Simplify float, int power function
Browse files Browse the repository at this point in the history
  • Loading branch information
nchristensen authored and inducer committed Oct 28, 2023
1 parent 28b0eb5 commit d6a81cd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions loopy/target/c/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,9 @@ def _preamble_generator(preamble_info, func_qualifier="inline"):
{res_ctype} y = 1;
while (n > 1) {{
if (n % 2) {{
if (n % 2)
y = x * y;
x = x * x;
}}
else
x = x * x;
x = x * x;
n = n / 2;
}}
Expand Down

0 comments on commit d6a81cd

Please sign in to comment.