From 5ed7e55d653c9aa330635e55feb0b65b39534a29 Mon Sep 17 00:00:00 2001 From: Austin Putland Date: Wed, 21 Jun 2023 16:41:52 -0300 Subject: [PATCH] Fix the case where eout % 3 produces a negative value --- src/CalcManager/Ratpack/conv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CalcManager/Ratpack/conv.cpp b/src/CalcManager/Ratpack/conv.cpp index 4f7609de..893da931 100644 --- a/src/CalcManager/Ratpack/conv.cpp +++ b/src/CalcManager/Ratpack/conv.cpp @@ -1171,7 +1171,7 @@ wstring NumberToString(_Inout_ PNUMBER& pnum, NumberFormat format, uint32_t radi { if (format == NumberFormat::Engineering) { - exponent = (eout % 3); + exponent = (3 + (eout % 3)) % 3; eout -= exponent; exponent++;