fix: bug when converting double 2 int

This commit is contained in:
2023-11-10 16:34:45 +08:00
parent cfbed0cc29
commit d932418aa9

View File

@ -5,7 +5,7 @@ inline ZYM::int2048 Any2Int(const std::any &value) {
return *ptr;
else if (auto ptr = std::any_cast<double>(&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));