From 2f8eadad6c35fbc8ec197863145abdba6c5ade17 Mon Sep 17 00:00:00 2001 From: Rerumu <25379555+Rerumu@users.noreply.github.com> Date: Wed, 7 Dec 2022 02:42:29 -0500 Subject: [PATCH] Try to fix #25 --- codegen/luau/runtime/runtime.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/codegen/luau/runtime/runtime.lua b/codegen/luau/runtime/runtime.lua index b80c668..cfaad23 100644 --- a/codegen/luau/runtime/runtime.lua +++ b/codegen/luau/runtime/runtime.lua @@ -40,6 +40,7 @@ do local math_abs = math.abs local math_fmod = math.fmod + local math_modf = math.modf local math_round = math.round local math_sign = math.sign local math_min = math.min @@ -81,13 +82,13 @@ do lhs = to_i32(lhs) rhs = to_i32(rhs) - return to_u32(lhs / rhs) + return to_u32((math_modf(lhs / rhs))) end function div.u32(lhs, rhs) assert(rhs ~= 0, "division by zero") - return to_u32(lhs / rhs) + return to_u32((math_modf(lhs / rhs))) end function rem.i32(lhs, rhs)