From 84555d13b9096d0f277902b94381577edbbedb65 Mon Sep 17 00:00:00 2001 From: CornerPin <7669876+CornerPin@users.noreply.github.com> Date: Thu, 18 Jun 2026 20:59:08 +0300 Subject: [PATCH] Fix printing complexes with zero imaginary part --- lua/entities/gmod_wire_expression2/core/complex.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/entities/gmod_wire_expression2/core/complex.lua b/lua/entities/gmod_wire_expression2/core/complex.lua index 4f38ebea92..f87e14255c 100644 --- a/lua/entities/gmod_wire_expression2/core/complex.lua +++ b/lua/entities/gmod_wire_expression2/core/complex.lua @@ -18,8 +18,8 @@ local atan2 = math.atan2 local function format(value) local dbginfo - if abs(value[1]) < 0 then - if abs(value[2]) < 0 then + if abs(value[1]) <= 0 then + if abs(value[2]) <= 0 then dbginfo = "0" else dbginfo = Round(value[2]*1000)/1000 .. "i" @@ -28,7 +28,7 @@ local function format(value) if value[2] > 0 then dbginfo = Round(value[1]*1000)/1000 .. "+" .. Round(value[2]*1000)/1000 .. "i" elseif abs(value[2]) <= 0 then - dbginfo = Round(value[1]*1000)/1000 + dbginfo = tostring(Round(value[1]*1000)/1000) elseif value[2] < 0 then dbginfo = Round(value[1]*1000)/1000 .. Round(value[2]*1000)/1000 .. "i" end