You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rounds a double-precision floating-point value to the nearest integral value.
返回结果:
The integer nearest a. If the fractional component of a is halfway between two integers, one of which is even and the >other odd, then the even number is returned. Note that this method returns a System.Double instead of an integral type.
The text was updated successfully, but these errors were encountered:
用乘二取整法计算小数点后的二进制码时,达到指定精度后应该截断小数部分取整数。
LonLatSegment
这个类的构造方法中用Math.Round来实现。但我发现C#的Math.Round方法做的是四舍五入而不是截断小数,导致了一些预期外的结果。
参考了这个Java实现(repo)直接将double强制转换为int,效果和Trucate是一样的。
我觉得这部分的代码可能需要修改为:
附Math.Round的方法描述:
The text was updated successfully, but these errors were encountered: