I noticed in another post, someone had done something like:
double d = 3.1415; int i = Convert.ToInt32(Math.Floor(d));
Why did they use the
Casting to int is implicit truncation, not implicit flooring:
double d = -3.14; int i = (int)d; // i == -3
I choose Math.Floor or Math.Round to make my intentions more explicit.