I was trying to create an enumerable containing a series of doubles from 0 to X. My first attempt was:
Enumerable.Range(0, 10).Cast<double>();
But this gives the error
Unable to cast object of type 'System.Int32' to type 'System.Double'.
If I can't cast int32 to double, then why does the following work?:
Enumerable.Range(0, 10).Select(i => (double) i);