From d932418aa9c1590b83a41314102798e80b7240a8 Mon Sep 17 00:00:00 2001 From: ZhuangYumin Date: Fri, 10 Nov 2023 16:34:45 +0800 Subject: [PATCH] fix: bug when converting double 2 int --- src/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.cpp b/src/utils.cpp index 284a310..6060f5f 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -5,7 +5,7 @@ inline ZYM::int2048 Any2Int(const std::any &value) { return *ptr; else if (auto ptr = std::any_cast(&value)) { std::stringstream buf; - buf << std::fixed << std::setprecision(0) << *ptr; + buf << std::fixed << std::setprecision(0) << std::floor(*ptr); std::string tmp; buf >> tmp; return std::move(ZYM::int2048(tmp));