You can check how exactly your value is represented within double
variable using code posted by Eric Lipper on his blog: Looking inside a double
For your Convert.ToDouble(decimal.MinValue)
it prints following info:
Raw sign: 1
Raw exponent: 10001011111
Raw mantissa: 0000000000000000000000000000000000000000000000000000
Normal
Sign: -
Exponent: 96
Exact binary fraction: 1.0000000000000000000000000000000000000000000000000000
Nearest approximate decimal: -7,92281625142643E+28
Exact rational fraction: -79228162514264337593543950336
Exact decimal fraction: -79228162514264337593543950336
Exact decimal fraction is the most important part here.
exact decimal fraction: -79,228,162,514,264,337,593,543,950,336
decimal.MinValue: -79,228,162,514,264,337,593,543,950,335
As you can see, it's slightly lower than decimal.MinValue
, and that's why you're getting an exception.
The same case applies to Convert.ToSingle(Convert.ToSingle(decimal.MinValue))
.