Every time I use Math.Round/Floor/Ceiling I always cast to int (or perhaps long if necessary). Why exactly do they return double if it's always returning an integer.
Math.Round/Floor/Ceiling
int
long
double
The result might not fit into an int (or a long). The range of a double is much greater.
Approximate range of double: ±5.0 × 10?324 to ±1.7 × 10308
(Source)
2.1m questions
2.1m answers
60 comments
56.9k users