The Int32.MaxValue saved at compile time, and in fact your code will be converted to Convert.ToDouble(0x7FFFFFFF) at compile time. Equivalent IL:
ldc.i4 FF FF FF 7F call System.Convert.ToDouble
This value is also stored, so it can be obtained at run time through reflection.
However, Convert.ToDouble is a function that is evaluated only at runtime.
As minitech shows, (double)Int32.MaxValue is evaluated at compile time. Equivalent IL:
ldc.r8 00 00 C0 FF FF FF DF 41
source share