From 4b64a61348e281bb37b66c37e57a9f3b5b115cef Mon Sep 17 00:00:00 2001 From: ctw Date: Wed, 22 Sep 2021 19:19:15 +0800 Subject: [PATCH] return back to the previous Signed-off-by: ctw --- ts2panda/ts2abc/ts2abc.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ts2panda/ts2abc/ts2abc.cpp b/ts2panda/ts2abc/ts2abc.cpp index 0c8b4fd68b..4f928f5185 100755 --- a/ts2panda/ts2abc/ts2abc.cpp +++ b/ts2panda/ts2abc/ts2abc.cpp @@ -12,7 +12,6 @@ * limitations under the License. */ -#include #include #include #include @@ -122,11 +121,6 @@ static bool IsValidInt32(double value) value >= static_cast(std::numeric_limits::min())); } -static bool EqualZero(double number) -{ - return abs(number - 0.0) < std::numeric_limits::epsilon(); -} - // Unified interface for debug log print static void Logd(const char *format, ...) { @@ -358,7 +352,7 @@ static void ParseInstructionImms(const Json::Value &ins, panda::pandasm::Ins &pa double imsValue = imms[i].asDouble(); Logd("imm: %lf ", imsValue); double intpart; - if (EqualZero(std::modf(imsValue, &intpart)) && IsValidInt32(imsValue)) { + if (std::modf(imsValue, &intpart) == 0.0 && IsValidInt32(imsValue)) { pandaIns.imms.emplace_back(static_cast(imsValue)); } else { pandaIns.imms.emplace_back(imsValue); -- Gitee