本文共 197 字,大约阅读时间需要 1 分钟。
默认隐式转换 uint64 到 double,会出现精度丢失的情况,
经过测试发现采用下面方法就不会有问题
double UInt64ToDouble(uint64 uValue)
{
int64 n64Value = (int64)uValue;
double dbValue = (double)n64Value;
return dbValue;
}
反向转换也是要显式的类似强转这样的操作
转载地址:http://djzli.baihongyu.com/