【发布时间】:2013-03-07 02:13:46
【问题描述】:
我正在寻找 C# 中 floor(x) 的实现,以便它与 C++ 版本匹配。
floor of 2.3 is 2.0
floor of 3.8 is 3.0
floor of -2.3 is -3.0
floor of -3.8 is -4.0
由于 C++ 审阅者将检查我的代码,floor 在 C# 中的哪些实现是合理的,这样他就不会拔掉他(最后剩下的)头发?
【问题讨论】:
-
你为什么不google
c# floor? -
@KirkWoll Dumb 遗漏我的部分 - 我浏览了我的浏览器历史并以为我搜索过它,但被translating this from C++ to C# that I missed that step淹没了
标签: c# floating-point int floor