Hello Pascal,
Because
string x = double.MinValue.ToString();
rounds x to -1.79769313486232E+308, whereas the actual minimum value
is -1.7976931348623157E+308. This is a bit higher, so you get the overflow
error when you try to convert it back.
Try using
string x = double.MinValue.ToString("R");
to convert using the 'round trip' (no rounding) format instead.
I hope that helps.
"Pascal" <pa****@unknown.com> wrote in message
news:c1**********@reader08.wxs.nl...
Why does this not work, and how should i do this convert in stead:
string x = double.MinValue.ToString();
double y = Convert.ToDouble(x);
i get this exception:
An unhandled exception of type 'System.OverflowException' occurred in
mscorlib.dll Additional information: Value was either too large or too small for a
Double.
Pascal