From 8a476cd4649a2efdd05e674689452c93c6e2a5b8 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Thu, 12 Sep 2024 18:13:56 -0500 Subject: [PATCH] Floor division --- lua/src/p0013.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/src/p0013.lua b/lua/src/p0013.lua index c5d3da0a..c8a8d359 100644 --- a/lua/src/p0013.lua +++ b/lua/src/p0013.lua @@ -224,7 +224,7 @@ return { do if arr[j] > ten18 then - arr[j - 1] = arr[j - 1] + arr[j] / ten18 + arr[j - 1] = math.floor(arr[j - 1] + arr[j] / ten18) arr[j] = arr[j] % ten18 end end @@ -232,7 +232,7 @@ return { while arr[1] > ten10 do - arr[1] = arr[1] / 10 + arr[1] = math.floor(arr[1] / 10) end return arr[1]