From 1644fcdf8eae58bd6e0d90577f5776d4de1e1879 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Fri, 12 Feb 2021 10:05:04 -0500 Subject: [PATCH] Bigint exponentiation by 1 now returns a clone --- libs/bigint/bigint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/bigint/bigint.lua b/libs/bigint/bigint.lua index 19b02b1..286e70e 100644 --- a/libs/bigint/bigint.lua +++ b/libs/bigint/bigint.lua @@ -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()