On Mon, 14 Dec 2009 04:57:26 -0500, Don <[email protected]> wrote:

In the very rare cases where the result of an integer division was actually intended to be stored in a float, an explicit cast would be required. So you'd write:
double y = cast(int)(1/x);

To me,

double y = cast(double)(1/x);

makes more sense. Why cast to int?

Reply via email to