Bigint exponentiation by 1 now returns a clone

pull/16/head
Ishaan Bhardwaj 2021-02-12 10:05:04 -05:00
parent f3c1cf6e1f
commit 1644fcdf8e
1 changed files with 1 additions and 1 deletions

View File

@ -447,7 +447,7 @@ function bigint.exponentiate(big, power)
if (bigint.compare(exp, bigint.new(0), "==")) then
return bigint.new(1)
elseif (bigint.compare(exp, bigint.new(1), "==")) then
return big
return big:clone()
else
local result = bigint.new(1)
local base = big:clone()