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)
1.4m articles
1.4m replys
5 comments
57.0k users