From 507f5ebe46c847c7f72d49ec74ee18b8608b9c63 Mon Sep 17 00:00:00 2001 From: Joel Verhagen Date: Wed, 3 Jan 2024 11:40:16 -0500 Subject: [PATCH] Add modf implementation in classic --- CSharp.lua/CoreSystem.Lua/CoreSystem/Core.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CSharp.lua/CoreSystem.Lua/CoreSystem/Core.lua b/CSharp.lua/CoreSystem.Lua/CoreSystem/Core.lua index 6020edd7..33ef83cf 100644 --- a/CSharp.lua/CoreSystem.Lua/CoreSystem/Core.lua +++ b/CSharp.lua/CoreSystem.Lua/CoreSystem/Core.lua @@ -743,6 +743,14 @@ else return v end + function System.modf(x, y) + local v = x % y + if v ~= 0 and x * y < 0 then + return v - y + end + return v + end + local function toUInt(v, max, mask, checked) if v >= 0 and v <= max then return v