From 76eb363d35c6d470685e7be8d244c8fb5aa1da46 Mon Sep 17 00:00:00 2001 From: Rerumu Date: Sun, 26 Jun 2022 03:18:09 -0400 Subject: [PATCH] Fix nearest `f32` and `f64` --- codegen/luajit/runtime/runtime.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/luajit/runtime/runtime.lua b/codegen/luajit/runtime/runtime.lua index 5a34df8..f0a3f25 100644 --- a/codegen/luajit/runtime/runtime.lua +++ b/codegen/luajit/runtime/runtime.lua @@ -113,7 +113,7 @@ do function nearest.f32(num) local result = round(num) - if math_abs(num) % 1 == 0.5 and temp_2 % 2 == 1 then + if math_abs(num) % 1 == 0.5 and result % 2 == 1 then result = result - 1 end