From 85aeca9d9fb5fcccc40ba71244c8516a45ceba3d Mon Sep 17 00:00:00 2001 From: Rerumu Date: Fri, 8 Jul 2022 02:43:38 -0400 Subject: [PATCH] Fix large integer initialization --- codegen/luau/runtime/numeric_tb.lua | 2 +- codegen/luau/runtime/numeric_v3.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen/luau/runtime/numeric_tb.lua b/codegen/luau/runtime/numeric_tb.lua index 91f33e6..c7775c2 100644 --- a/codegen/luau/runtime/numeric_tb.lua +++ b/codegen/luau/runtime/numeric_tb.lua @@ -31,7 +31,7 @@ function Numeric.into_u32(data) end function Numeric.from_u64(value) - return from_u32(bit_and(value), bit_and(value / 0x100000000)) + return from_u32(bit_and(value % 0x100000000), bit_and(value / 0x100000000)) end function Numeric.into_u64(value) diff --git a/codegen/luau/runtime/numeric_v3.lua b/codegen/luau/runtime/numeric_v3.lua index 82b4816..0f51d09 100644 --- a/codegen/luau/runtime/numeric_v3.lua +++ b/codegen/luau/runtime/numeric_v3.lua @@ -47,7 +47,7 @@ function Numeric.into_u32(value) end function Numeric.from_u64(value) - return from_u32(bit_and(value), bit_and(value / 0x100000000)) + return from_u32(bit_and(value % 0x100000000), bit_and(value / 0x100000000)) end function Numeric.into_u64(value)