mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 17:49:02 -06:00
Bigint exponentiation by 1 now returns a clone
This commit is contained in:
parent
f3c1cf6e1f
commit
1644fcdf8e
@ -447,7 +447,7 @@ function bigint.exponentiate(big, power)
|
|||||||
if (bigint.compare(exp, bigint.new(0), "==")) then
|
if (bigint.compare(exp, bigint.new(0), "==")) then
|
||||||
return bigint.new(1)
|
return bigint.new(1)
|
||||||
elseif (bigint.compare(exp, bigint.new(1), "==")) then
|
elseif (bigint.compare(exp, bigint.new(1), "==")) then
|
||||||
return big
|
return big:clone()
|
||||||
else
|
else
|
||||||
local result = bigint.new(1)
|
local result = bigint.new(1)
|
||||||
local base = big:clone()
|
local base = big:clone()
|
||||||
|
Loading…
Reference in New Issue
Block a user