Does the following look like it should throw an exception?
Double.Parse(Double.MaxValue.ToString())
I didn’t think so either, but it turns out I was wrong. Double.MaxValue.ToString() yields 1.79769313486232E+308 when the actual maximum value of a Double is 1.7976931348623157E+308. Ok, we’ll shave off a few digits of precision with the default formatting and round up. Sure…Turns out you need to use the “roundtrip” option…sigh. Thanks to this reference.
Double.Parse(Double.MaxValue.ToString("R"))
Thank you!