Skip to content

Commit

Permalink
Floor division
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 12, 2024
1 parent 21b2c52 commit 8a476cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/src/p0013.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ 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
end

while arr[1] > ten10
do
arr[1] = arr[1] / 10
arr[1] = math.floor(arr[1] / 10)
end

return arr[1]
Expand Down

0 comments on commit 8a476cd

Please sign in to comment.