X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/eabec5f434225aa68aa33565d8cf5055f287662e..820f9eddfe36813309cf4dc7893bdac2a16bc26e:/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