Skip to content

Commit

Permalink
Add faster power function alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
ybeyer committed Jun 21, 2022
1 parent 96d8610 commit 25d1a46
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions operations/powerFast.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function c = powerFast(a,b)

c = a;
for i = 2:b
c = c .* a;
end

end

0 comments on commit 25d1a46

Please sign in to comment.