Why does Math.Floor(Double) return a value of type Double?
问题 I need to get the left hand side integer value from a decimal or double. For Ex: I need to get the value 4 from 4.6. I tried using Math.Floor function but it's returning a double value, for ex: It's returning 4.0 from 4.6. The MSDN documentation says that it returns an integer value. Am I missing something here? Or is there a different way to achieve what I'm looking for? 回答1: The range of double is much wider than the range of int or long . Consider this code: double d =