X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/eabec5f434225aa68aa33565d8cf5055f287662e..31acfe7a5fe499c1698ae23ada97519b4b262469:/luatz/timetable.lua?ds=inline diff --git a/luatz/timetable.lua b/luatz/timetable.lua index e2930d8..0dbf4c8 100644 --- a/luatz/timetable.lua +++ b/luatz/timetable.lua @@ -76,8 +76,8 @@ local function carry ( tens , units , base ) tens = tens + idiv ( units , base ) units = units % base elseif units < 0 then - tens = tens - 1 + idiv ( -units , base ) - units = base - ( -units % base ) + tens = tens + idiv ( units , base ) + units = ( base + units ) % base end return tens , units end