<分区>
Possible Duplicate:
Why does Math.Floor(Double) return a value of type Double?
为什么 C# Math.Floor()
返回 double
而不是 int
来自 MSDN 文档:
Returns the largest integer less than or equal to the specified double-precision floating-point number
它说它返回一个整数。可以返回 double
,我总是可以将它转换为 int
,但这很奇怪,不是吗?